Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iif statement driving me insane

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
0
0
GB
Can anybody see anything blatantly wrong with this?

Size: IIf([Pricing].[size]="A0" Or [Pricing].[size]="A1" Or [Pricing].[size]="A2",100,0)

It's supposed to put 100 in a field if a size is A0, A1, or A2, and 0 for anything else.
The trouble is, whilst it seems to most of the time, I have tests with fixed data that it doesn't pick up on.

Any help gratefully appreciated.

Douglas If it don't make you laugh, it ain't true.
 
Have you tried using "Like"?

Size: IIf([Pricing].[size] Like "A0" Or [Pricing].[size] Like "A1" Or [Pricing].[size]Like "A2",100,0)
 
If this is in a query grid replace commas (,) with semicolons (;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top