Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I include the Start Date and End Date in the Between Date Query

Status
Not open for further replies.

TanmedIT

IS-IT--Management
Nov 6, 2000
53
US
I am writing a report that uses 2 parameter fields for a date range and when I choose for instance March 1 (Start Date) and March 31 (End Date). In the Select Expert I have used the between dates statement and even used: {RecDate} >= StartDate and {RecDate} <= EndDate

But they are still not including any transactions made on the EndDate.

Any Ideas? I am using CR7
 
Does your report have a date field or a datetime field?
Are your parameters date or DateTime?
Do you have the report set to convert datetime to date?

A date with no time is considered midnight. Anything with a time (on that day) would be considered a greater value than midnight. If it is consistent you may need to add one day to your EndDate in the formula. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Hey, this may or may not help.
I'm not sure why yours isn't working, but first try:
date({RecDate}) in {?start-date} to {?end-date},
where start-date is March 1 and end-date is March 31.

If this doesn't work, try:
{RecDate} >= {?start-date} and {RecDate} < {?end-date},
where start-date is March 1 and end-date is April 1.

The trouble may be that you are comparing date-times to dates, and if you enter March 31, 2001 as an end-date, it sees March 31, 2001 4:30 pm as coming after your end-date, and it won't be included. Hopefully one of the above methods works for you.

Or I may be totally wrong :eek:)
 
Adding an additional day to insure that my parameter queries include all records for the date range entered was inacceptable.

I found this to be helpful:

Between DateValue([Enter Begin Date]) And DateValue([Enter End Date])+#11:59:59 PM#
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top