Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    11

    Question Unanswered: How to get date & time in one column?

    Hello

    After executing an sql query, I get date & time in one column but I require
    date in 'dd-mm-yyyy' format, when I give : to_date(datefieldname,
    'dd-mm-yyyy' ), time disappears, when I give : to_Char(datefieldname,
    'hrs:mm:ss' ), date disappears. How to get both(date & time in one column).

    Looking forward for an early reply.

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Try:
    Code:
    to_char(datefieldname, 'dd-mm-yyyy hh24:mi:ss' )
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Nov 2004
    Posts
    11

    Thumbs up



    Thanks, it worked. Actually, till now, I was doing to_char(datefieldname, 'dd-mm-yyyy' 'hh24:mi:ss' ) ( ' ) was present.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    To avoid such mistakes, read the documentation about format models.

Posting Permissions

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