Query for date 1 year ago or greater

J

J Roberts

I am trying to get all of my records that have a date(no time) 1 year ago from today or greater. Thanks in advance
 
D

Dale Fye

Select *
FROM yourTable
Where [DateField] <= DateAdd("yyyy", -1, Date))

--
HTH

Dale Fye


I am trying to get all of my records that have a date(no time) 1 year
ago from today or greater. Thanks in advance
 
L

Liza

Try:

<Now()-365

In the criteria line of the date field.

-----Original Message-----
I am trying to get all of my records that have a date(no
time) 1 year ago from today or greater. Thanks in advance
 
D

Dale Fye

Liza,

Not every year has 365 days.

--
HTH

Dale Fye


Try:

<Now()-365

In the criteria line of the date field.

-----Original Message-----
I am trying to get all of my records that have a date(no
time) 1 year ago from today or greater. Thanks in advance
 
V

Van T. Dinh

Just a small corrrection:

....Where [DateField] >= DateAdd("yyyy", -1, Date())

i.e. changing less than or equal to greater than or equal
and addition of the opening parenthesis just after Date.

HTH
Van T. Dinh
MVP (Access)
 
D

Dale Fye

Guess it depends on how you interpret "1 year ago from today or
greater".

I interpreted it to mean 1 year or more from todays date, you
obviously interpreted it to mean between one year ago and today.

--
HTH

Dale Fye


message Just a small corrrection:

....Where [DateField] >= DateAdd("yyyy", -1, Date())

i.e. changing less than or equal to greater than or equal
and addition of the opening parenthesis just after Date.

HTH
Van T. Dinh
MVP (Access)
 
V

Van T. Dinh

Yes, I agreed. After I posted, I re-read the original question and wondered
whether I was right about >= or not ...
 

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