locked
SQL query RRS feed

  • Question

  • how to convert varchar into datetime with string value mm/dd/yy hh/mi/ss AM/PM
    Tuesday, July 5, 2016 1:24 PM

Answers

  • You can use the CONVERT function with argument 101:

    select convert(datetime, '12/31/2016 01:03:03PM', 101)

    Since you asked in the Training and Certification forum, this is covered in course 20461C "Querying Microsoft SQL Server".

    Wednesday, July 6, 2016 5:32 AM