IFF Function

  • Thread starter Thread starter NatalyM246
  • Start date Start date
N

NatalyM246

I'm trying to create and iff function in a report im using as a weight log. I
want it to sum the net weight of each type. Here's what i got:

=iff(["type"=CRTS],[sum("net")],0) "type" & "net" are field names
 
Rather than trying to use the IIF() function, what about the idea of using a
Totals query to derive the number?

You could GroupBy your field [type], select only where [type] = "CRTS", and
use Sum on the [net] field.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
I'm trying to create and iff function in a report im using as a weight log. I
want it to sum the net weight of each type. Here's what i got:

=iff(["type"=CRTS],[sum("net")],0) "type" & "net" are field names

For one thing, it's IIF not IFF; for another, square brackets are used to
delimit fieldnames, and quotes to delimit text strings - so you have it
exactly backward.

I agree with Jeff that I'm sure there are better ways to do this, but the
proper syntax would be

=IIF([Type] = "CRTS", Sum([Net]), 0)
 
Back
Top