DateDiff and all results not showing

G

Guest

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!
 
G

Guest

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.
 

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