In
Tearadata time difference calculation is bit tricky compared to SQL Command DateDiff(HH, Date1, Date2)
So
here is Syntax/ Code for calculating Time difference in Hours between Today's date and EventDate
Syntax:
SELECT
CAST( CURRENT_DATE AS TIMESTAMP(6)) -- Today's Date
, EventDate -- Date you want to check with
,(CAST(EventDate AS
TIMESTAMP(6)
)- CAST(CURRENT_DATE
AS TIMESTAMP(6) )) DAY(4) TO MINUTE AS DHM -- Time difference
in Days Hours:Minutes
,24* EXTRACT(DAY FROM (DHM)) -- Hours
calculation by Days
,EXTRACT(HOUR FROM (DHM)) -- extracting
extra hours from apart from complete day
,24* EXTRACT(DAY FROM (DHM)) + EXTRACT(HOUR FROM (DHM)) AS HoursDiff -- Exact
Time difference in Hours
FROM Database.TableName