May 18, 2005 #1 Ant0 Technical User Joined May 3, 2005 Messages 17 Location GB I can't work out how to return a whole number from select sysdate-stamp from foo; where stamp is a timstamp column with a default value of sysdate. All I want ot do is minus the two and capture all rows where the difference is 1.
I can't work out how to return a whole number from select sysdate-stamp from foo; where stamp is a timstamp column with a default value of sysdate. All I want ot do is minus the two and capture all rows where the difference is 1.
May 18, 2005 1 #2 SantaMufasa Technical User Joined Jul 17, 2003 Messages 12,588 Location US Ant, "1" what? 1 Year, 1 Month, 1 Day, 1 Hour, 1 Minute, 1 Second, 1/10 Second, 1/100 Second, 1 millisecond? We can offer code as soon as we know what "1" means. Mufasa (aka Dave of Sandy, Utah, USA) http://www.dasages.com Do you use Oracle and live or work in Utah, USA? Then click here to join Utah Oracle Users Group on Tek-Tips. Upvote 0 Downvote
Ant, "1" what? 1 Year, 1 Month, 1 Day, 1 Hour, 1 Minute, 1 Second, 1/10 Second, 1/100 Second, 1 millisecond? We can offer code as soon as we know what "1" means. Mufasa (aka Dave of Sandy, Utah, USA) http://www.dasages.com Do you use Oracle and live or work in Utah, USA? Then click here to join Utah Oracle Users Group on Tek-Tips.
May 18, 2005 Thread starter #3 Ant0 Technical User Joined May 3, 2005 Messages 17 Location GB Sorry, 1 day. Upvote 0 Downvote
May 18, 2005 #4 SantaMufasa Technical User Joined Jul 17, 2003 Messages 12,588 Location US Ant, Here are some data: Code: SQL> select stamp from foo; STAMP ---------------------------- 18-MAY-05 09.31.13.542000 AM 13-DEC-03 12.56.44.000000 AM Here are whole-number differences between the current date/time and the dates: Code: col a heading "Days|Diff" format 999 select trunc(sysdate-cast(stamp as date)) a from foo; Days Diff ---- 0 522 Let us know if this resolves your need. Mufasa (aka Dave of Sandy, Utah, USA) http://www.dasages.com Do you use Oracle and live or work in Utah, USA? Then click here to join Utah Oracle Users Group on Tek-Tips. Upvote 0 Downvote
Ant, Here are some data: Code: SQL> select stamp from foo; STAMP ---------------------------- 18-MAY-05 09.31.13.542000 AM 13-DEC-03 12.56.44.000000 AM Here are whole-number differences between the current date/time and the dates: Code: col a heading "Days|Diff" format 999 select trunc(sysdate-cast(stamp as date)) a from foo; Days Diff ---- 0 522 Let us know if this resolves your need. Mufasa (aka Dave of Sandy, Utah, USA) http://www.dasages.com Do you use Oracle and live or work in Utah, USA? Then click here to join Utah Oracle Users Group on Tek-Tips.
May 18, 2005 Thread starter #5 Ant0 Technical User Joined May 3, 2005 Messages 17 Location GB Perfect, thank you. Upvote 0 Downvote