zachvaldez
asked on
using Time In Crystal reports
I have a time field in a table but I'd like to use tiis in Crystal Report. I need to get syntax for between times Startime and Endtime whic are parameters.
field name is Time_Entered
field name is Time_Entered
ASKER
specifically, the date range in that field is between 7:00:00 pm and 12:00:00 AM
The range doesn't matter unless it crosses midnight
Assuming you have START TIME and END TIME parameters and the user enters them that way
This should work
mlmcc
Assuming you have START TIME and END TIME parameters and the user enters them that way
This should work
Local TimeVar StopTime := {?End Time};
If StopTime = Time(0,0,0) then
StopTime := Time(23, 59, 59);
DateDiff ('n',CDateTime(Today, {?Start Time}), CDateTime(Today, StopTime))
Another wayLocal TimeVar StopTime := {?End Time};
If StopTime = Time(0,0,0) then
DateDiff ('n',CDateTime(Today, {?Start Time}), CDateTime(Today+1, StopTime))
Else
DateDiff ('n',CDateTime(Today, {?Start Time}), CDateTime(Today, StopTime))
mlmcc
ASKER
since I'm going to place this in the Report... record like where clause in a SQL statement..
what I'm asking is something like express in Sql but in this case in Crystal.
so in short please translate this in crystal
where Enttime between 7:00 pm and 12:00 pm...
what I'm asking is something like express in Sql but in this case in Crystal.
so in short please translate this in crystal
where Enttime between 7:00 pm and 12:00 pm...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for showing ways to do it
DateDiff ('n',CDateTime(Today,{?My Parameter}), CDateTime(Today, {?My Parameter 2}))
n - minutes
h - hours
s - seconds