date query

M

mbparks

I need to select all records where the date is more than 3 years old. I've
tried "<5/1/06" and "Before 5/1/06" and neither seemed to work.
Please help. Thank you.
 
P

Piet Linden

I need to select all records where the date is more than 3 years old.  I've
tried "<5/1/06" and "Before 5/1/06" and neither seemed to work.
Please help.  Thank you.

SELECT *
FROM MyTable
WHERE [DateField]<#5/1/06#
 
R

raskew via AccessMonster.com

If this calculation is going to be repeated at different times,
you may want to use a statement that doesn't involve
inputting an actual date, e.g.:

WHERE [DateField] < DateAdd("m", -36, date())

Lookup the DateAdd() function in the Help File for a
detailed explanation.

Bob

Piet said:
I need to select all records where the date is more than 3 years old.  I've
tried "<5/1/06" and "Before 5/1/06" and neither seemed to work.
Please help.  Thank you.

SELECT *
FROM MyTable
WHERE [DateField]<#5/1/06#
 
M

mbparks

Perfect. Thank you both so much.

raskew via AccessMonster.com said:
If this calculation is going to be repeated at different times,
you may want to use a statement that doesn't involve
inputting an actual date, e.g.:

WHERE [DateField] < DateAdd("m", -36, date())

Lookup the DateAdd() function in the Help File for a
detailed explanation.

Bob

Piet said:
I need to select all records where the date is more than 3 years old. I've
tried "<5/1/06" and "Before 5/1/06" and neither seemed to work.
Please help. Thank you.

SELECT *
FROM MyTable
WHERE [DateField]<#5/1/06#
 

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