Solved

Access 97 - General Date Format

Posted on 2004-08-23
3
1,069 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 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

13 Experts available now in Live!

Get 1:1 Help Now