Trouble comparing dates

G

Guest

In a daily data upload, there are two dates (Settle Date, and Process Date)
that I need to compare to achieve a third date that I can use to perform a
select query on this same data. When I produce the expression
"SelectionDate: IIF([SettleDate]>=[ProcessDate],[SettleDate],[ProcessDate]",
I get the desired result. But I then need to establish a criteria selection
on that new field for the Select part of the Query. When I try to do that, I
am getting a message that basically says that the expression is too
complicated, etc. Do I need to create a new table with the first Query and
then a Select Query on the new table with the new field that I created, or
can I perform it in the original Query? Please help, if you need me to be
more specific just tell me what you need to know.
Thanks,
Semperfi1967
 
J

John Vinson

In a daily data upload, there are two dates (Settle Date, and Process Date)
that I need to compare to achieve a third date that I can use to perform a
select query on this same data. When I produce the expression
"SelectionDate: IIF([SettleDate]>=[ProcessDate],[SettleDate],[ProcessDate]",
I get the desired result. But I then need to establish a criteria selection
on that new field for the Select part of the Query. When I try to do that, I
am getting a message that basically says that the expression is too
complicated, etc.

You might need to be sure Access knows that the criterion is a date.
If you use a literal date, enclose it in # signs - otherwise it may
think that 1/30/2005 is one divided by thirty divided by 2005!

I'd suggest a criterion of

CDate([Enter search date:])


John W. Vinson[MVP]
 

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