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

(Multi) IIF…Then…Else query question help needed.

Status
Not open for further replies.

MikeFL

Programmer
Jul 12, 2002
58
US
Can someone help or guide me in writing a nested (multi) IIF query statement that will return one of the following 3 results (Complete, Expired or Open) answers when its run? I’ve looked in the Access 2003 help files and can’t figure it out.

The field names are:

F10_IIF_Answer (formatted as text)
F10_PIS_CSD_Date (formatted as number)
F7_PIS_Letter_Open_Date (formatted as number)
F8_PIS_Letter_End_Date (formatted as number)

1st Logic: If F10_PIS_CSD_Date >0 and F7_PIS_Letter_Open_Date >0 (answer should be Complete)

2nd Logic: If F8_PIS_Letter_End_Date =0 (answer should be Expired)

3rd logic: Else (answer should be Open)

What I’ve tried but doesn’t work below:

F10_IIF_Answer: IIf([F10_PIS_CSD_Date]>0,[F7_PIS_Letter_Open_Date]>0,"Complete") And IIf([F8_PIS_Letter_End_Date]=0,"Expired","Open")
 
iif(F10_PIS_CSD_Date >0 and F7_PIS_Letter_Open_Date >0, "Complete", iif(If F8_PIS_Letter_End_Date = 0, "Expired", "Open"))

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Thanks Lespaul for your help!

I will try it Monadya morning and let you know how it works!
 
Thanks Lespaul for your help! It Worked!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top