If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
IIF statement pulling from wrong field
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. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/201002/1 |
#2
|
|||
|
|||
IIF statement pulling from wrong field
see in-line comments
-- Daryl S "jligue via AccessMonster.com" wrote: 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) 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. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/201002/1 . |
#3
|
|||
|
|||
IIF statement pulling from wrong field
It is working, MANY thanks!
Daryl S wrote: 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. -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|