iif then in MSAccess

  • Thread starter Laura1 via AccessMonster.com
  • 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!
 
A

Aaron Kempf

iif has been depecrated
you should be usnig CASE WHEN THEN

look for more info in SQL Server Books online
 
J

Jason Lepack

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
 
L

Laura1 via AccessMonster.com

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top