how to remove time from datetime

前端 未结 10 1625
清酒与你
清酒与你 2020-12-01 10:18

The field DATE in the database has the following format:

2012-11-12 00:00:00

I would like to remove the time from the date and return the d

10条回答
  •  春和景丽
    2020-12-01 10:49

    I found this method to be quite useful. However it will convert your date/time format to just date but never the less it does the job for what I need it for. (I just needed to display the date on a report, the time was irrelevant).

    CAST(start_date AS DATE)
    

    UPDATE

    (Bear in mind I'm a trainee ;))

    I figured an easier way to do this IF YOU'RE USING SSRS.

    It's easier to actually change the textbox properties where the field is located in the report. Right click field>Number>Date and select the appropriate format!

提交回复
热议问题