Hi,
I have a query that needs to look for two criteria in order to post back the correct answer. The following sql keeps coming back stating "error". Is is even possible to do this?
Thanks,
Leesha
GreaseTrap1: IIf([contractversion]=1 And [store type]="SUP",True)
Conditional Statement using And / or
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
-
- Administrator
- Posts: 78574
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Conditional Statement using And / or
You omitted the 3rd argument, it is required. This should work:
GreaseTrap1: IIf([contractversion]=1 And [store type]="SUP",True,False)
but the following has the same effect and is shorter:
GreaseTrap1: [contractversion]=1 And [store type]="SUP"
GreaseTrap1: IIf([contractversion]=1 And [store type]="SUP",True,False)
but the following has the same effect and is shorter:
GreaseTrap1: [contractversion]=1 And [store type]="SUP"
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: Conditional Statement using And / or
Perfect! Thanks!