Discussion:
Date Query
(too old to reply)
Hendrix
2011-06-13 14:59:12 UTC
Permalink
I have a table with a date field. I will be running the query from
time to time and would like to set it up so that it extracts records
where the date is 40 yrs before the current date. Is it possible set
this type of query?
John W. Vinson
2011-06-13 16:01:57 UTC
Permalink
Post by Hendrix
I have a table with a date field. I will be running the query from
time to time and would like to set it up so that it extracts records
where the date is 40 yrs before the current date. Is it possible set
this type of query?
Sure. Use a criterion of

=DateAdd("yyyy", -40, Date())

See the VBA help for DateAdd, it has a number of choices.
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
Loading...