I would like to know how to get the difference between two date times. The issue I am facing is that I have to convert the date from the table, to a usable date. i.e. 7841433540 converts to 09/10/14 09:19:00. My sql to return those values is:
SELECT ddt.tochar(ENC_START_DDT,'MM/DD/YY HH24:MI:SS') "Admit",
TO_CHAR(SYSTIMESTAMP,'MM/DD/YY HH24:MI:SS') "Today"
from CCDBA.PATIENT where CCDBA.PATIENT.PAT_SEQ = '101067048';
Now I thought I could...
SELECT ddt.tochar(ENC_START_DDT,'MM/DD/YY HH24:MI:SS')-TO_CHAR(SYSTIMESTAMP,'MM/DD/YY HH24:MI:SS')
from CCDBA.PATIENT where CCDBA.PATIENT.PAT_SEQ = '101067048';
But that returns:
ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause:
*Action:
Any help is greatly appreciated