Advertisement

04.28.2007 at 01:53PM PDT, ID: 22540525
[x]
Attachment Details

Difference between two dates as a single column

Asked by Sanmarie in Oracle 8.x, Oracle Database, SQL Query Syntax

Tags: , , ,

Using Oracle 8i

I have a query that returns 3 columns col1, col2, Time_Diff from myTable as shown below. Time_Diff is the difference between a date column (col3) in myTable and SysDate.

Select A.col1, A.col2, B.Time_Diff
from myTable A,  (Select (sysdate - col3 ) As "Time_Diff" from Dual) B

Also, I would like Time_Diff to be returned in the format 01:15, meaning the time difference is 1 hour, 15 minutes.

Please help me as I have very limited knowledge of how to write oracle queries.

Thanks
SanStart Free Trial
[+][-]04.28.2007 at 02:25PM PDT, ID: 18995370

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2007 at 02:27PM PDT, ID: 18995376

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2007 at 03:07PM PDT, ID: 18995478

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2007 at 03:15PM PDT, ID: 18995499

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2007 at 06:38PM PDT, ID: 18995913

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.29.2007 at 12:48AM PDT, ID: 18996506

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.29.2007 at 11:05AM PDT, ID: 18997952

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2007 at 11:42AM PDT, ID: 18998066

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Oracle 8.x, Oracle Database, SQL Query Syntax
Tags: between, dates, difference, two
Sign Up Now!
Solution Provided By: awking00
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.30.2007 at 07:22AM PDT, ID: 19001548

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.30.2007 at 08:51AM PDT, ID: 19002266

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32