Convert a SQL Server datetime to a shorter date format

前端 未结 10 516
一个人的身影
一个人的身影 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:54

    If you have a datetime field that gives the results like this 2018-03-30 08:43:28.177

    Proposed: and you want to change the datetime to date to appear like 2018-03-30

    cast(YourDateField as Date)
    

提交回复
热议问题