iif then in MSAccess

  • Thread starter Thread starter Laura1 via AccessMonster.com
  • Start date Start date
L

Laura1 via AccessMonster.com

if someone could help me write this query I'd really appreciate it.

I want it to return the lessor of the two dates:

so it would be in english is account open date is less then the referral date
then account open date else referral date.

Sounds so easy in english now how do I get it to work in access???

Thank you!
 
iif has been depecrated
you should be usnig CASE WHEN THEN

look for more info in SQL Server Books online
 
The structure of iif is like this:
iif(condition, result if true, result if false)

Add the table that contains these dates (I assume that they are in the
same table)

You can enter this in the "Field" row of the query designer:
NewDate: iif([Account Open Date] < [Referral Date], [Account Open
Date], [Referral Date])

Cheers,
Jason Lepack
 
Fantastic it worked great!! Thank you so very very much!! I now understand
iif statements and can write them on my own!

Jason said:
The structure of iif is like this:
iif(condition, result if true, result if false)

Add the table that contains these dates (I assume that they are in the
same table)

You can enter this in the "Field" row of the query designer:
NewDate: iif([Account Open Date] < [Referral Date], [Account Open
Date], [Referral Date])

Cheers,
Jason Lepack
if someone could help me write this query I'd really appreciate it.
[quoted text clipped - 9 lines]
 
Back
Top