Results 1 to 3 of 3

Thread: convert var char field to date field

  1. #1
    Join Date
    Sep 2005
    Posts
    2

    convert var char field to date field

    Hi,

    I need to convert a var char field to date field (DD/MM/YYYY)

    Current convertion format:
    CAST(Report_Date as DATETIME)

    How can i convert to Date field with date format of DD/MM/YYYY?

    Thanks.

    Onn Onn

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Try this:

    select convert(datetime, report_date, 103)

  3. #3
    Join Date
    Dec 2004
    Posts
    502
    No, you have to convert to datetime first and then convert to varchar with a particular style:

    select CONVERT(varchar, convert(datetime, report_date), 103)

Posting Permissions

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