Compare dates

N

nisreenkh

1- How can I compare various dates in Access query. For example, I have a
"purchase date", "sold date", with which i want to compare with a "start
date" and "end date". The date format is dd/mm/yy. Can this comparison be
done in 1 condition; i.e start date < purchase date < end date,..
2- Can date comparison be put in an IIF statement in a query, because i
always get #error when I use it.
Thanks
 
M

Michel Walsh

Sure, but if the field name has spaces in it, you must use [ ] around it.


iif( [start date] < [pourchase date] , "yo!", "arrrg!" )



if you use more than one condition, use something like:


iif( [start date] < [purchase date] AND [delivery date] < [end
date] , "All is fine", "We have a problem boss" )




Vanderghast, Access 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