Display all records between two dates

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

Hello all, i would like to show all records printed between two dates. My
date format is 01/01/07. The table which i am using has this format

My first column has this, Days: DateDiff("y",[Print Date],Now())

I used the following which is not working. Between #01/01/07# And #31/12/07#

Any help would be much appreciated...
 
Well, the datediff function should be returning the number of days between two
dates. SO looking for that calculation to be between two dates makes no sense.

Also, I would use "d" not "y" to calculate the number of days between two
dates - although both should work correctly.

So you probably need the following to get records with a print date in 2007
Field: [Print Date]
Criteria: Between #01/01/07# And #31/12/07#

And the calculation to see how many days have elapsed between the print date
and today's date.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
I believe your date format will NEED to be changed.....

======================================

See:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html

The article explains how Access uses your Regional Settings in the
interface, but expects the American format delimited with # for
literal
dates in SQL statements and VBA. Also identifies the 3 cases where
Access is
likely to misunderstand your dates.


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

=======================================

Ron
 
Thanks John and Ron, it is working fine now, i import an excel spreadsheet
with the data on and it was all coming in as Text and not Date/Time. Thank
you so much for the input.

best regards,
 
Back
Top