URGENT - to_char sysdate strength behaviour
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: URGENT - to_char sysdate strength behaviour

  1. #1
    Join Date
    Nov 2000
    Posts
    416

    Question URGENT - to_char sysdate strength behaviour

    SELECT TO_CHAR(SYSDATE,'hh24:mm:ss AM')
    FROM DUAL

    has returned
    15:10:42 PM
    ....
    a few minutes later, the same command has returned
    15:10:01 PM

    Why ?? Very strength !!! Any explanation?
    An ounce of prevention is worth a pound of cure

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    It is doing what is expected. If you want the month to appear as the minutes, keep using mm. Otherwise, use mi for minutes...


    SQL> SELECT TO_CHAR(SYSDATE,'hh24:mm:ss AM')
    2 FROM DUAL;

    TO_CHAR(SYS
    -----------
    14:10:04 PM

    SQL> ed
    Wrote file afiedt.buf

    1 SELECT TO_CHAR(SYSDATE,'hh24:mi:ss AM')
    2* FROM DUAL
    SQL> /

    TO_CHAR(SYS
    -----------
    14:06:16 PM

  3. #3
    Join Date
    Nov 2000
    Posts
    416
    OOOPS , Silly me. Thanks Steven. It solved.
    An ounce of prevention is worth a pound of cure

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    I think everyone has done that at least once.

  5. #5
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    Originally posted by stecal
    I think everyone has done that at least once.
    I don't know but many times our VB duhlopers have come to me complaining there is problem with the Oracle database date.



    Sanjay

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