Dates in queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

What I am after is to be able to enter a date but with the month and year as
a wildcard so it will always pull up only the workorder before or after a
certain date. without using the between / range

so for example what i want to enter is as follows

Date > 16/*/* so it will pull up everything after the 16 day but without the
user havnig to go in and change the month or year.

any suggestions?
 
Dates are actually stored as numbers, so you can't use wildcards with them.

If you're looking for dates after the 16th of the current month, you can use
DateSerial(Year(Date), Month(Date), 16)

If you're looking for dates after the 16th of the previous month, you can
use
DateSerial(Year(Date), Month(Date)-1, 16)

(and yes, that works fine in January, even though Month(Date) returns 1, so
that the middle parameter is 0)
 
Back
Top