?
Solved

Access 97 - General Date Format

Posted on 2004-08-23
3
Medium Priority
?
1,092 Views
Last Modified: 2007-12-19
Good Afternoon,

I have an Audit table that stores the date and time that a record was changed using the General Date Format (in the table). I am creating a report that will show all the records changed between dates (the user chooses on a form with unbound fields for entering the date). In my query I am using the following criteria:

Between [Forms]![frmChangeReports]![txtStartDate] And [Forms]![frmChangeReports]![txtEndDate]

Problem is that if a record was changed on 8/23/2004 9:17:05 AM and on my search form I put 08/01/04 to 08/23/04 I don't get the record referenced above.

Is there an easy solution to this (other than changing the format of the date in the table)?

Let me know if you need more information.

Lena
0
Comment
Question by:LenaWood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
ornicar earned 500 total points
ID: 11875923
Simply add 1 day to the user's input using DateAdd function:

Between [Forms]![frmChangeReports]![txtStartDate] And DateAdd("d",1,[Forms]![frmChangeReports]![txtEndDate])

To be very precise we should add 23h 59m only, but noone is working at 00:00 :)

0
 
LVL 18

Expert Comment

by:Data-Man
ID: 11876190
You could do it like this if you like

Between [Forms]![frmChangeReports]![txtStartDate] And Cdate(Clng([Forms]![frmChangeReports]![txtEndDate]) + .999988425925926)


The value .999988425925926 is really 23:59:59

Mike
0
 
LVL 10

Author Comment

by:LenaWood
ID: 11881189
Mike - I get the same message that the calculation is too complex :-(

Ornicar - your suggestion seems to do just want I wanted too.  Thanks!

Lena
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question