
PROBLEM - Selecting records based on Date Range
Question :
Is there a Problem with using the Date Function when the "to Date" of the
date range is the Current Date? ( I tested the CurrentDate function and it
also failed)
I am currently using Crystal Reports ver 6.0 VB5 and SQL Server 7.
In VB , I am dynamically creating a Selection formula which includes the
users selected "Start" and "End" dates as follows:
{Scrap.Dt_Entered} in Date (1999, 04, 01) to Date (1999, 05, 03)
Even though records do exist within this range, none are displayed. (May 3,
by the way, was the current date)
Now try to follow me:
1. Using select expert I created a formula as follows: {Scrap.Dt_Entered}
in Date (1999, 04, 07) to Date (1999, 05, 03) - This one worked. Notice the
start date is April 7,1999 - it is a record that exists in the table. I
selected the first date in the combo selection box which has a list of all
the existing values for {Scrap.Dt_Entered}. There are no records for April
1, 1999, which was the "Start" date I originally tried to use.
2. The problem seems to be related to TODAYS DATE (MAY 3,1999 for example).
When I change the formula to {Scrap.Dt_Entered} in Date (1999, 04, 01) to
Date (1999, 05, 02) or {Scrap.Dt_Entered} in Date (1999, 04, 07) to Date
(1999, 05, 04) , all the records are selected - ALMOST . The only records
that do not get selected are the records that fall on the "to Date" (so I
have to add a day to the "To Date") . (This latter problem is revealed in
the Crystal Knowledge Base)
Thanks in advance for your assistance.
Yours kindly,
Enzo