Converting to mm/dd/yyyy format

前端 未结 2 472
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-10 19:15

I have a table called SF_Data and there is a column called IN_Date, ID the data looks like:

ID      IN_Date
1       9/8/2010
2       26/04/2011
3       20/09/201         


        
2条回答
  •  伪装坚强ぢ
    2021-02-10 19:38

    You need a convert to fix the data (to the correct datatype) before formatting...

    Select
         convert(varchar,
             convert(date, IN_Date, 103),
         101)
    from dbo.SF_Data
    

提交回复
热议问题