Does anyone have a formula on hand to get the diff...
# suiteql
c
Does anyone have a formula on hand to get the difference in seconds or miliseconds between two timestamps? When I try: SYSDATE - lastmodified, I get a string output like this: -0 15650.0
r
Try this, I think it might work: (sysdate-to_date(lastmodified)) * 24 * 60 * 60,
s
This calculates the UNIX timestamps of each field, and then subtracts them.
Copy code
SELECT ((to_date(sys_extract_utc(lastmodifieddate)) - DATE '1970-01-01') * 86400 + to_char(sys_extract_utc(lastmodifieddate), 'SSSSS')) -
       ((to_date(sys_extract_utc(createddate)) - DATE '1970-01-01') * 86400 + to_char(sys_extract_utc(createddate), 'SSSSS'))
FROM   transaction