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

  • Thread starter Thread starter MJJ
  • Start date Start date
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.
 
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.
 
Back
Top