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
I am new to access; trying to create a query for a report that has a subtotal,
the field will only total if a portion of a word appears in a combo box of another field. Specifically, if the Product Type field (which is a combo box) has the word "bag" in it, I want the value in the Qty field to be counted. If the word "bag" is not in the Product Type field, then no value is populated in the newly created field. Ultimately a final subtotal will be needed for the report. |
#2
|
|||
|
|||
iif statement
You would need an expression something like the following as a control's
control source =SUM(IIF(" " & [Product Type] & " " Like "* BAG *",Qty,Null)) or you could use a calculated field in the query and then sum it in the report. Field: BAGQty: IIF(" " & [Product Type] & " " Like "* BAG *",Qty,Null) John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County jligue wrote: I am new to access; trying to create a query for a report that has a subtotal, the field will only total if a portion of a word appears in a combo box of another field. Specifically, if the Product Type field (which is a combo box) has the word "bag" in it, I want the value in the Qty field to be counted. If the word "bag" is not in the Product Type field, then no value is populated in the newly created field. Ultimately a final subtotal will be needed for the report. |
Thread Tools | |
Display Modes | |
|
|