-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.

Juan M.
  • 59
  • 1
  • 5
  • 5
    Possible duplicate of [Sql Server string to date conversion](http://stackoverflow.com/questions/207190/sql-server-string-to-date-conversion) – Freek Wiekmeijer Nov 03 '15 at 09:52

1 Answers1

1

Why not just use the same query:

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

Select CONVERT(date, @date, 103)

103 is the correct style to use with Convert for British/French dates (dd/mm/yyyy)

Output as date:

2015-11-03
Julien Vavasseur
  • 3,854
  • 1
  • 20
  • 29