Skip to content
Advertisement

How to get time difference (in hours) between 2 dates

I am trying to get the time difference between 2 users, I need the difference in hours.

I tried to use DATEDIFF function but it’s wrong.

Here is my code:

Advertisement

Answer

You must have a from clause in your select statement. Something like

returns number of days between date1 and date2.

If you want number of hours:

(this is only for oracle)

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement