TSQL: datetime from character string error

前端 未结 3 1429
北恋
北恋 2021-01-28 06:20

There are some posts related to this but I\'m so new to TSQL that I cannot make sense of them so please excuse me.

My procedure has:

    BEGIN TRY

              


        
3条回答
  •  死守一世寂寞
    2021-01-28 07:07

    Change CONVERT(DATETIME, @mydate, 102) to CONVERT(DATETIME, @mydate, 100)

    or just CONVERT(DATETIME, @mydate)

    reference to CAST and CONVERT and http://www.sqlusa.com/bestpractices/datetimeconversion/ on MSDN

提交回复
热议问题