not sure why I am stuck but can someone tell me ho...
# general
m
not sure why I am stuck but can someone tell me how to calculate the number of hours between two date/time fields? in a saved search using date/time1-date/time2 does not seem to give me hours
b
are they date columns or datetime columns
m
datetime
its datetime1-datetime2 age in hours
b
although it looks ridiculous, convert the timestamps to dates
Copy code
TO_DATE(TO_CHAR({datetime1}, 'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(TO_CHAR({datetime2}, 'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS')
will give you difference in days
m
thanks I will give this a shot
b
i personally hope someone has a better solution
k
I've always been able to just subtract them and divide by 24
Now, often times I have to do an additional thing to break it up into two columns, one for days and one for hours
So that it was readable