-1

When I want to "translate" a Ndate figure into dd/MM/yyyy I use this

convert(varchar(16),dateadd(day, d.Field_Date, '01-01-1970'),103)

But I have a field that's VARCHAR(512) with that very format, and I'd like to convert that string to a date format.

Could you (yes, you :-)) tell me how to do it in SQL Server language?

Thank you.

4

1 回答 1

1

为什么不使用相同的查询:

declare @date varchar(512) = '03/11/2015'

Select CONVERT(date, @date, 103)

103 是Convert用于英国/法国日期的正确样式 (dd/mm/yyyy)

输出为日期:

2015-11-03
于 2015-11-03T10:06:58.730 回答