Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    26

    Unanswered: Subtract 1 sec from date field with dual

    How do I subtract 1 second from a date field using dual?

    Example:

    SELECT...
    INTO..
    FROM DUAL;

    Thanks,

    CougarTrace

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You do NOT need to use dual to subtract 1 second.
    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.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Code:
      1  select to_char(sysdate,'mm/dd/yyyy hh24:mi.ss') time,
      2* to_char(sysdate - 1/(24*60*60),'mm/dd/yyyy hh24:mi.ss') time2 from dual
    SQL> /
    
    TIME                       TIME2
    -------------------   -------------------
    05/02/2006 16:50.56 05/02/2006 16:50.55
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •