Solved

Access 97 - General Date Format

Posted on 2004-08-23
3
1,071 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
3 Comments
 
LVL 9

Accepted Solution

by:
ornicar earned 125 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

914 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now