select records for past year

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.
 
R

Rick Brandt

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()
 
J

John Vinson

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.
 
G

Greg Kraushaar

Between Date and (Date-365)

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

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

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