none
Is It possible to change the default style used by CONVERT when converting DATETIME? By default it is taking format #0 for conversion while DateTime2 is taking format #121 for conversion. I am looking for the DateTime type to return date in format #121 ? RRS feed

  • Question

  • Is It possible to change the default style used by CONVERT function when converting DATETIME? By default it is taking format #0 for conversion while DateTime2 is taking format #121 for conversion. I am looking for the DateTime type to return date in format #121 ?

    Thursday, March 31, 2016 10:39 AM

Answers

  • Are you talking about the SQL CONVERT function?

    If so, then this isn't really the correct forum: there is a forum for SQL Server transact-SQL

    (Though if you look at this link, you'll see you can specify an optional style parameter to the CONVERT function that specifies the format

    E.g

    SELECT CONVERT(nvarchar(30), GETDATE(), 121)

    Thursday, March 31, 2016 10:46 AM