IFF Function

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
 
J

Jeff Boyce

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.
 
J

John W. Vinson

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Need Help with an IF statement 3
re Iff function 5
IFF Statement 6
Need help on Iff Statement 1
Using IFF function in textboxes 1
IIf 1
How to fix formula to avoid divide/zero and aggregate issue. 5
Formulas 1

Top