Solved

Problem with date range in a query

Posted on 2011-02-24
2
394 Views
Last Modified: 2012-08-13
I have a form with two fields... txtStart and txtEnd.  Then in my query syntax I have...
Between Forms!frmMainMenu!txtStart and Forms!frmMainMenu!txtEnd

If I enter today's date in both fields I get 10 returns returned with today's date.  But if I enter today's date as the start date and tomorrow's date as the end date I get more records that contain today's date and some with tomorrow's date.  Why am I not seeing all of today's records when I enter today's date in both fields?

--Steve
0
Comment
Question by:SteveL13
  • 2
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
your date field contains time values, check this out.

to get around this, you need to add a day in your date range

Between Forms!frmMainMenu!txtStart and Dateadd("d",1, Forms!frmMainMenu!txtEnd)

or use

DateValue([DateField] Between Forms!frmMainMenu!txtStart and Forms!frmMainMenu!txtEnd
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
or use

DateValue([DateField]) Between Forms!frmMainMenu!txtStart and Forms!frmMainMenu!txtEnd
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

743 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

17 Experts available now in Live!

Get 1:1 Help Now