Link to home
Create AccountLog in
Avatar of Maliki Hassani
Maliki HassaniFlag for United States of America

asked on

Crystal Reports: Best way to write a time query

Hello Experts,

I am trying to duplicate a query that is in SQl to Crystal syntax.  I am trying to get a true or false for the following:

Event_Start_Time is greater than 60 minutes from the Ticket_Create_Date.  In SQL the where clause looks like:
FROM EVENT_TABLE
WHERE (UDF_CONVERT_UNIX_DATETIME(EVENT_START_TIME, 'US/Eastern') + INTERVAL '1' HOUR) < UDF_CONVERT_UNIX_DATETIME(DATE_CREATED, 'US/Eastern')

If I knew how to write the + interval '1'Hour I could figure it out.  The table output is in unix time or I can have it as a date_time format.  I have views that changes the format.

if ({EVENT_TABLE.TKT_DATE_ACTUAL_START} < {EVENT_TABLE.TKT_DATE_CREATED}) by 1 hour Then
    'Greater than 1 hour'
else
    'Less than 1 hour';
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Maliki Hassani

ASKER

Thanks, will review!
Excellent!  Thank you again!