Solved

Problem with date range in a query

Posted on 2011-02-24
2
439 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
[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
  • 2
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 34969493
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34969498
or use

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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 …

688 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