View Single Post
 
Old February 4th, 2004, 12:53 PM
azizmasih azizmasih is offline
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi mcmouli,

Sorry, I goofed up in the query...


SQL> select
  2 to_char(dt, 'fmDay, dd Month yyyy hh24:mi:ss') "Date" ,
  3 to_char(sysdate, 'fmDay, dd Month yyyy hh24:mi:ss') "Sysdate",
  4 to_char(sysdate - 50/24, 'fmDay, dd Month yyyy hh24:mi:ss') "Sysdate - 50 hours",
  5 decode( sign(dt - (sysdate - 50/24)),
  6 -1, 'Date is less than sysdate - 50 hours',
  7 1, 'Date is greater than sysdate - 50 hours',
  8 'Date is equal to sysdate - 50 hours') "Message"
  9 from t
 10 /

Date Sysdate Sysdate - 50 hours Message
------------------------------------- ------------------------------------- ------------------------------------- ---------------------------------------
Thursday, 1 January 2004 15:15:30 Wednesday, 4 February 2004 10:53:32 Monday, 2 February 2004 8:53:32 Date is less than sysdate - 50 hours
Tuesday, 3 February 2004 10:34:45 Wednesday, 4 February 2004 10:53:32 Monday, 2 February 2004 8:53:32 Date is greater than sysdate - 50 hours

SQL>

Cheers,
azizmasih