Converting to mm/dd/yyyy format

前端 未结 2 1376
终归单人心
终归单人心 2021-02-10 19:10

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:53

    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
    

提交回复
热议问题