问题
I am using the following command to remove the time from the date field:
SELECT CONVERT(VARCHAR(10), FieldValue,101) FROM table
FieldValue
is a char field, but has a date i.e. 2012-09-30 00:00:00
The above command returns 2012-09-30
, but I need it to be 09/30/2012
Any idea what I need to add to the command?
回答1:
Yes, you should use format()
format(Fields!YourField.Value, "MM/dd/yyyy")
来源:https://stackoverflow.com/questions/14281221/convert-char-field-to-date-field-and-remove-time-from-the-field-name