on 09-08-2008 8:11 PM
Hi All,
I am using CR2008 and designer to create a report. I am having a question regarding timeframe.
I want to return a result within a timeframe in the past several days.
I have a date range and time range parameters for user to specify a date range and time frame within the days. For instance return the results in the past 10 days between 6:30 AP to 4:30PM
I know the below works for a pair of start/end date.
{table.field} in {?Date Range}
I am wondering if anyone know how to create formula in Select Expert to handle the time frame in a date range?
Thanks in advance.
Dennis
If you have a date/time field create two new time parameters start time and end time:
Then change your record selection to:
({table.field} in {?Date Range})
AND
(Time ({table.field}) >= {?StartTime} and Time ({table.field}) <= {?EndTime})
Edited by: James Terry on Sep 8, 2008 10:13 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis
Is it possible for you to define the field as DateTime datatype in the database itself.
It could make a lot of date time manipulations in the Crystal Reports easier.
The current requirement would get taken care of automatically if this is possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dennis,
Try this:
{table.field} in (DateAdd('d', {?NumOfDaysParameter}, CurrentDate) to CurrentDate) AND
Time({Table.Field}) in (Time(6:30 AP) to Time(4:30PM))
Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.