IIF Query Help

J

Jim

I am trying to use the following two IIF statements in a query and the "like
part of the statement is not working.

column one MTD_Qty_Merch: Sum((IIf([Selection#] Like
"MH8-6????",[Quantity],0)))

and column two MTD_Qty_Music: Sum((IIf([Selection#] Not Like
"MH8-6????",[Quantity],0)))

In previous queries using a = to value works correctly. But here I need the
wildcarding.

Thanks,
 
D

Douglas J. Steele

What about

Sum((IIf(Left([Selection#], 5) = "MH8-6",[Quantity],0)))

and

Sum((IIf(Left([Selection#], 5) <> "MH8-6",[Quantity],0)))
 
Top