IIF statement

  • Thread starter jligue via AccessMonster.com
  • Start date
J

jligue via AccessMonster.com

Not entirely sure if the IIF statement is the correct way to go about this, I
have a field on a query that has total pounds of either printed or plain
product. I want to add a column to my query that only adds up the printed
product.
So, if "product type" = printed, then add up a total, is basically what I am
trying to say.
Can you help me with the proper formula?
 
J

John Spencer

SUM(IIF([Product Type] = "Printed",[Pounds],Null))

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
B

BlairH

How do you know if it is printed or plain?

If that is identified in another field, add a expression field to your query:

PrintedQty: IIF([Type]="Printed",[Qty],0)

Then total PrintedQty
 
J

jligue via AccessMonster.com

Product Type is defined as Plain or Printed, so I use that as my base field.
So if that is printed, then I want to count the value that is in the total
pounds field.
How do you know if it is printed or plain?

If that is identified in another field, add a expression field to your query:

PrintedQty: IIF([Type]="Printed",[Qty],0)

Then total PrintedQty
Not entirely sure if the IIF statement is the correct way to go about this, I
have a field on a query that has total pounds of either printed or plain
[quoted text clipped - 3 lines]
trying to say.
Can you help me with the proper formula?
 
J

jligue via AccessMonster.com

If i need to say "like *printed*" rather than equal to printed, how exactly
does that spell out? Thank you in advance.
 

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

Top