Help with Date Expression in Query

T

TSG

Duane said:
Take a look at using DateAdd(). From your description, the criteri
under
the InsertDate field would be:
=DateAdd("yyyy",-1, Date())

--
Duane Hookom
MS Access MVP


"TSG" [email protected] wrote in message

I have a DB with a table that has InsertDate as one of the fields. I
would like my query to show every record in the DB with an InsertDate
equal to today's date one year ago and earlier. I'm actaull
tracking
the number records entered into the DB this year versus last year and
will run a report to show whether or not the records are increasin
or
decreasing to date. Any help will be greatly appreciated.

Thanks!

This worked to give the number of recoords that have an InsertDat
equal to today's date a year ago. After reviewing my post, I don'
know if I was exactly clear on what I need. I actually want the quer
to ALL records with an Insert date of any date within last year up t
today's date. I guess I would need a start date?

For example, I want to see every record with an Insertdate betwee
August 25, 2004 and today's date of 2004. I apologize for an
inconvience.

Thanks
 
F

fredg

This worked to give the number of recoords that have an InsertDate
equal to today's date a year ago. After reviewing my post, I don't
know if I was exactly clear on what I need. I actually want the query
to ALL records with an Insert date of any date within last year up to
today's date. I guess I would need a start date?

For example, I want to see every record with an Insertdate between
August 25, 2004 and today's date of 2004. I apologize for any
inconvience.

Thanks!


As criteria you can use:
1) Between DateAdd("yyyy",-1, Date()) and Date()
or..
2) >=DateAdd("yyyy",-1, Date())
if there are no records past today's date.
 
J

John Vinson

For example, I want to see every record with an Insertdate between
August 25, 2004 and today's date of 2004. I apologize for any
inconvience.

BETWEEN #8/25/2004# AND DateAdd("yyyy", -1, Date())

will do the job


John W. Vinson[MVP]
 
Top