Search code examples
sqloracle11g

How to calculate difference between two dates in oracle 11g SQL


When I am trying to calculate the date difference by using datediff function it showing that invalid identifier.

SELECT DATEDIFF(day,'2008-08-05','2008-06-05') AS DiffDate from da_static_trade.

Error : invalid identifier.

Can you please tell me what is the function to calculate date difference.


Solution

  • There is no DATEDIFF() function in Oracle. On Oracle, it is an arithmetic issue

    select DATE1-DATE2 from table