SQL for Time
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: SQL for Time

  1. #1
    Join Date
    May 2001
    Location
    Brazil
    Posts
    13
    How can I make a SQL that return to me a column date minus another column date with the format like this '05:55 PM'.


    Thanks.....

  2. #2
    Join Date
    Nov 2000
    Posts
    9

    Wink Date option


    select to_char(sysdate,'hh12:mi AM') "Date" from dual;

    this is to return with minus option

    select '-'||to_char(sysdate,'hh12:mi AM') "Date" from dual;
    (OCP)

  3. #3
    Join Date
    May 2001
    Location
    Brazil
    Posts
    13

    SQL for Time

    No, you didn't understand, I want to select the difference between two dates in this format.


    Thanks....

  4. #4
    Join Date
    Jul 2000
    Posts
    521
    date-date is a valid operation and the result is just a number. This is the difference of time. There can not be any am/pm attached to it.
    svk

Posting Permissions

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



Click Here to Expand Forum to Full Width