Query for date 1 year ago or greater

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

Guest

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

Similar Threads


Back
Top