IIF statement pulling from wrong field

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

jligue via AccessMonster.com

I have a query have has the 5 variations of the following IIF statement: Bag
Total: IIf(" " & [Unit of Measure] & " " Like "* BAG *",[Qty],Null) this
statement says to add up if the unit of measure if it is a bag.
I am attempting to add another IIF statement that says =Sum(IIf([product type]
Like "*printed*", [pounds], 0)) - I am trying to add up if the product type
has the word printed in it total it at each customer and at the end of the
report.
When I use this IIF statement on my report, it is totalling the amount from
the printed IIf(" " & [Unit of Measure] & " " Like "* BAG *",[Qty],Null)
amount, not the pounds column.

The product type is a text field, the pounds field is a number field.

I need help writing the proper IIF statement, changing the other IIF
statements, or defining how the fields are defined. Thank you.
 
D

Daryl S

see in-line comments
--
Daryl S


jligue via AccessMonster.com said:
I have a query have has the 5 variations of the following IIF statement: Bag
Total: IIf(" " & [Unit of Measure] & " " Like "* BAG *",[Qty],Null) this
statement says to add up if the unit of measure if it is a bag.
I am attempting to add another IIF statement that says =Sum(IIf([product type]
Like "*printed*", [pounds], 0)) - I am trying to add up if the product type
has the word printed in it total it at each customer and at the end of the
report.
When I use this IIF statement on my report, it is totalling the amount from
the printed IIf(" " & [Unit of Measure] & " " Like "* BAG *",[Qty],Null)
amount, not the pounds column.

If you want the pounds column totalled for this, use this:
IIf(" " & [Unit of Measure] & " " Like "* BAG *",[pounds],Null)
 
J

jligue via AccessMonster.com

It is working, MANY thanks!

Daryl said:
see in-line comments
I have a query have has the 5 variations of the following IIF statement: Bag
Total: IIf(" " & [Unit of Measure] & " " Like "* BAG *",[Qty],Null) this
[quoted text clipped - 6 lines]
the printed IIf(" " & [Unit of Measure] & " " Like "* BAG *",[Qty],Null)
amount, not the pounds column.

If you want the pounds column totalled for this, use this:
IIf(" " & [Unit of Measure] & " " Like "* BAG *",[pounds],Null)
The product type is a text field, the pounds field is a number field.

I need help writing the proper IIF statement, changing the other IIF
statements, or defining how the fields are defined. Thank you.
 

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


Top