Dates - make query field to specify "Past" or "Future"

M

MJJ

I have a database which details holidays, and I have had to construct it
specifically to include all dates. I want to make a field that specifies
whether the holiday is future or past - I cannot work out how to speficy that
if the date is larger than today the field should read "Future" and if it is
smaller, then the field should read "Past" Any help would be very gratefully
received.
 
B

Banana

Put this in your query design:

DateStatus: Iif([MyHoliday]>Date(),"Future","Past")

Substitute the "MyHoliday" with actual name of the column that contains
the holiday day. Basically, it compares with the today's date and if
it's larger then "Future" is returned, otherwise it's Past.

Note it will also declare the holiday falling on today's date to be in
past and that may not be what you want. If you want to use present, you
may want to nest another Iif() on where the "Past" is to decide between
Past and Present.
 

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