Convert a SQL Server datetime to a shorter date format

前端 未结 10 517
一个人的身影
一个人的身影 2021-01-30 05:59

I have a datetime column in SQL Server that gives me data like this 10/27/2010 12:57:49 pm and I want to query this column but just have SQL Server ret

10条回答
  •  抹茶落季
    2021-01-30 06:57

    The original DateTime field : [_Date_Time]

    The converted to Shortdate : 'Short_Date'

    CONVERT(date, [_Date_Time]) AS 'Short_Date'
    

提交回复
热议问题