Results 1 to 3 of 3

Thread: date formatting

  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: date formatting

    Hi,
    I would like to convert the date format output of the following query to
    DD MM YYYY hh:mm.

    1> select crdate from sysdatabases where name = "tempdb"
    2> go
    crdate
    --------------------------
    Feb 17 2004 4:45AM

    (1 row affected)
    1>

    Is there a simple way to do that? ASE is 11.9.2.
    Thanks a lot for help.

    Regards Eric

  2. #2
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524
    Code:
    select convert(char(2),crdate, 4) -- Day
             +" "+convert(char(2), crdate, 1) -- Month
             +" "+convert(char(4), crdate, 102) -- Year
             +" "+convert(char(5), crdate, 108) 
    from sysdatabases 
    where name = "tempdb"

  3. #3
    Join Date
    Oct 2003
    Posts
    3
    Originally posted by fadace
    Code:
    select convert(char(2),crdate, 4) -- Day
             +" "+convert(char(2), crdate, 1) -- Month
             +" "+convert(char(4), crdate, 102) -- Year
             +" "+convert(char(5), crdate, 108) 
    from sysdatabases 
    where name = "tempdb"
    Hi,
    thanks a lot help. It's beautiful.

    Eric

Posting Permissions

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