Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2006
    Posts
    10

    Thumbs up Unanswered: how to get time from datetime field

    Hi All

    how to grt time from datetime field inm ASE 11.5,12.5

  2. #2
    Join Date
    Jun 2006
    Posts
    16
    you select the column.
    if you want to display a certain format like 01/01/2006 or Jan 01,2006
    use convert function

  3. #3
    Join Date
    Aug 2004
    Posts
    15
    Try dateformat. Example to dislplay the time form now() use:
    select dateformat(now(),'hh:mm:ss')

    To dislpay the date you can use:
    dateformat(now(),'MM/DD/YYYY')

    To display both you can use:
    select dateformat(now(),'MM/DD/YYYY hh:mm:ss')

    EDIT:You can substitute now() with your datetime field

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Quote Originally Posted by tpl7370
    Try dateformat. Example to dislplay the time form now()
    Not in Sybase ASE, use convert e.g.
    select convert(char(8),getdate(),8)

  5. #5
    Join Date
    Aug 2004
    Posts
    15
    Sorry I have Adaptive Server Anywhere and assumed it was the same.

Posting Permissions

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