time difference in minutes

Posted on 2009-02-19
Medium Priority
Last Modified: 2013-12-07

How to get with sql statements time difference in minutes between two dates? For example:
19.02.2009 6:54:32       and       18.02.2009 14:45:00

Question by:rtratar
  • 2
LVL 41

Expert Comment

ID: 23689758

declare @date1 datetime,@date2 datetime
set @date1 = '02.18.2009 14:45:00'
set @date2 = '02.19.2009 6:54:32'
select datediff(mi,@date1,@date2)

Open in new window

LVL 41

Accepted Solution

Sharath earned 750 total points
ID: 23689776
In Oracle, try like this

select (date2-date1)*24*60 

Open in new window


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question