select records for past year

  • Thread starter Thread starter dlw
  • Start date Start date
D

dlw

I need a quick select command to get dates within the past
year, like Between (NOW) and (NOW) - (365 Days)
But that syntax doesn't work. :)
Thank you.
 
dlw said:
I need a quick select command to get dates within the past
year, like Between (NOW) and (NOW) - (365 Days)
But that syntax doesn't work. :)
Thank you.


BETWEEN Now()-365 AND Now()

Or

BETWEEN DateAdd("yyyy", -1, Now()) AND Now()
 
I need a quick select command to get dates within the past
year, like Between (NOW) and (NOW) - (365 Days)
But that syntax doesn't work. :)
Thank you.

Try

BETWEEN DateAdd("yyyy", -1, Date()) AND Date()

Actually if you leave off the parentheses and the word Days the syntax
you use will work too, unless you're after February 29 in a leap year.
 
Between Date and (Date-365)

or
(< Date()) and (> (Date()-365))

There are better ways that take into account leap years, bu this is
quick
 
Back
Top