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 ...
 
Back
Top