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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datetime parameters (adding time to date)

Status
Not open for further replies.

NervousRex

Programmer
Sep 4, 2003
66
US
I have a report that requires that the user select a start date and an end date for the range of the data.

Using the crystal report viewer, they select the 2 dates...

The first date has the correct time of 0,0,0 being 12:00:00AM

I would like to make the second date they choose move to 11:59:59PM, but would like to avoid having them enter it in the params.

Any ideas how I could do this?
 
If you use dates in your startdate and enddate, then 3/1/2005 and 3/4/2005 will be interpreted in Database->Show SQL Query as

{table.date} => 3/1/2005 00:00:00.00 and
{table.date} < 3/5/2005 00:00:00.00

and every record up to 3/4/2005 23:59:59 will be selected.

Cheers,
-LW
 
You are correct, but say they wanted everything for the month of Feb.

Using your method would require them to select these 2 dates:

2/1/2005 - 3/1/2005


This is not how they normally choose the end date so i'm trying to keep things the same across the board
 
I assume that we are talking about user entered parameters.

When prompted for a date range, the parameter screen also contains a check box on the right that is defaulted to include the value. If the user does not uncheck this box, then

When the user enters 2/1/2005 and 2/28/2005, Crystal will interpret that as

{table.field} => 2/1/2005 00:00:00.00
{table.field} < 3/1/2005 00:00:00.00

Conversely, if the user unchecks the include value, then

{table.field} => 2/1/2005 00:00:00.00
{table.field} < 2/28/2005 00:00:00.00


Cheers,
-LW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top