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

Letting Users Choose Dates for Records Selection

Status
Not open for further replies.

Shewolf925

Technical User
Jan 6, 2010
1
US
I'm attempting to build a report in Crystal 11 wherein the system asks user for a beginning and ending date so that they can limit the results they get to only those records within a certain date range.

In the old access database this was done by using the BETWEEN function in a query. However, when I try and do it in Crystal with a parameter it gives me an error when I try and run the query.

The field I'm querying on is in the DATE/TIME format, rather than just a date.

Any and all help is greatly appreciated.
 
Create two date parameters, FromDate and ToDate. Then in your record selection use:

Code:
date({Table.Date}) >= {?FromDate} and date({Table.Date}) <= {?ToDate}

This should work.
 
You could use either:

{table.datetime} in {?start} to {?end}

Or,

{table.datetime} >= {?start} and
{table.datetime} < {?end} + 1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top