Pulling Dates from 3 different columns

robruhr

Registered User.
Local time
Yesterday, 18:04
Joined
Mar 2, 2009
Messages
11
I have a query that pulls data & dates from other tables (Note, the tables are actually linked Excel Worksheets). On my query I have 3 date columns; "DUE", "REVISED", and "ESD". What I'd like to do is create a single column that will pull the correct dates accordingly: Always pull from the "ESD" column unless it is blank. If it is blank then pull from the "REVISED" column. And, if the "REVISED" column is blank, to pull from the "DUE" column. This is the formula I am currently using, however it is showing blank cells where it should be showing a date:

DUE DATE: IIf(Not (IsNull([ESD])),[ESD],IIf(Not (IsNull([REVISED])),[REVISED],[DUE]))

I'm thinking the blank cells are coming up because of incorrect formatting possibly on excel worksheet. I've tried changing the formatting to DATE on the excel worksheet cells, and as soon as I link it again with Access it shows the "REVISED" column as TEXT rather than DATE. Am I doing something wrong or missing something?

Thanks.
 
I was able to figure it out. I should have thought of this earlier. I had formulas in the excel sheet I was trying to pull info from. I just removed the formulas in the excel sheet and the above formula worked.
 

Users who are viewing this thread

Back
Top Bottom