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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf with OR??

Status
Not open for further replies.

wvmbark

Technical User
Feb 12, 2003
135
US
If I have a [TextField] and a [DateField]...

TextField can be "A", "B", "C", or "D".

In my query I have a calculated date field [CertDate] that I want to equal DateField if "A" or "B", and equal to today's date if not.

I've tried the following expressions with no luck:

CertDate: IIf([TextField]="A" Or [TextField]="B", [DateField], Date())

and this:

CertDate: IIf([TextField]="A",[DateField],IIf([TextField]="B",[DateField],[Date()))

Both work for "A", "C", and "D" but return today's date for "B".

What's the proper way to write the expression??

Thanks!!

Mike



 
The syntax seems OK.
Are you sure of the "B" value ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top