Query date range problem

F

Frank

I have query built on a table. The table has fields as follows:

One date field formatted as "Short Date." - [Date]
Two yes/no fields - [Name1] and [Name2]

The query date field criteria is: Between [start date] and [end date]

The criteria for[Name1] is Yes
No under the Or function

The criteria for[Name2] is No
Yes under the Or function


When I run the query, it does not return the correct number of records
between the entered dates. How do I resolve this???

Any assistance is greatly appreciated.
 
D

Douglas J. Steele

While the date field may be formatted as "Short Date", do it actually
contain time as well as date? If so, try Between [start date] and [end date]
+ 1
 
F

Frank

Doug:
The date does not entail time. Tried your suggestion yet without success.
Thanks for assistance. Any further comments are most welcomed.





Douglas J. Steele said:
While the date field may be formatted as "Short Date", do it actually
contain time as well as date? If so, try Between [start date] and [end
date] + 1


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Frank said:
I have query built on a table. The table has fields as follows:

One date field formatted as "Short Date." - [Date]
Two yes/no fields - [Name1] and [Name2]

The query date field criteria is: Between [start date] and [end date]

The criteria for[Name1] is Yes
No under the Or function

The criteria for[Name2] is No
Yes under the Or function


When I run the query, it does not return the correct number of records
between the entered dates. How do I resolve this???

Any assistance is greatly appreciated.
 
F

Frank

Solved problem.

Had to use the "Between And" expression once in criteria option under the
date field and once in the "or" option under the same date field. This,
then, accounted for Name1 and Name2 fields options.All works as it should
now.

Thanks once again for your assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top