Conditional Query

CarlRostron

Registered User.
Local time
Today, 12:39
Joined
Nov 14, 2011
Messages
88
I want to produce a conditional query. So for example, I have two dates, a baseline date and a reforecast date. I want to query a table and select only the later so ie if ReforecastDate> BaselineDate then return just the ReforecastDate otherwise return the BaselineDate.

I know how to select both fields and put it into a table but this conditional query would be much cleaner and neater than selecting all the baseline and reforecast fields and dealing with it afterwards.

Are you able to advise how I go about this in the Query Builder of Access. I am fairly comfortable building queries in there.

Thanks
 
How about using an Immediate IF - IIF() statement

Create a calculated field

MyDate: IIF([ReforecastDate] > [BaselineDate], [ReforecastDate], [BaselineDate])

JR
 

Users who are viewing this thread

Back
Top Bottom