If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Substracting two timestamp columns

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-12, 12:30
ijunaid ijunaid is offline
Registered User
 
Join Date: Feb 2012
Posts: 14
Substracting two timestamp columns

Hi friends,

i have one serious issue that has to be sorted out soon,

I need to substarct two timestamp columns and need to get the result.
The requirement is just like substarct two timestamp columns.
Ex:
(1999-04-14 12:12:12) - (2009-02-15 12:12:12)

any help, advice from anyone will be appreciated

Warm Regards
junaid
Reply With Quote
  #2 (permalink)  
Old 02-10-12, 12:37
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
BTW - IMO what you posted were not TIMESTAMP, but DATE datatypes.

Code:
  1  select to_date('2009-02-15 12:12:12','YYYY-MM-DD HH24:MI:SS') -
  2	    TO_DATE('1999-04-14 12:12:12','YYYY-MM-DD HH24:MI:SS') INTERVAL
  3* FROM DUAL
SQL> /

  INTERVAL
----------
      3595
difference UNIT of Measure is DAYS
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.

Last edited by anacedent; 02-10-12 at 12:41.
Reply With Quote
  #3 (permalink)  
Old 02-24-12, 09:43
ijunaid ijunaid is offline
Registered User
 
Join Date: Feb 2012
Posts: 14
Thanks u

Ur Solution Helped me bro.!!
Thx a lot
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On