DateDiff and all results not showing

A

AnneMarie

Dear Access Gurus,

Please help. I have a database in which I ask the user to put in a date and
then the query should pull all the dates for a one year previous period.
However, all the dates do not show up even though they are in the table. For
example, if the user enters 01/31/07 then 01/31/06 doesn't show up. My field
is a date field. Below is my query.

Between [enter date in format 01/01/07] And DateAdd("m",-12,Date())

Thank you!
 
K

KARL DEWEY

if the user enters 01/31/07 then 01/31/06 doesn't show up
Today is 4/17/2007 so DateAdd("m",-12,Date()) will give you 4/17/2006. The
date 01/31/06 is prior to that and not in between.

Are you wanting a one year spread from today or a one year spread from a
given date? From a given date would be like this ---
Between [enter date in format 01/01/07] And DateAdd("m",-12,[enter date
in format 01/01/07])

This will give you from date ented to one year back. Make sure you copy and
then paste the data entry prompt that is in brackets so there is no typos.
 
Top