I have a date field I pull in from excel as a varchar type and I currently convert it using this line:
convert(date,[Appt Date],103) as [Appt date]
this works but the result is a date in the following format:
YYYY/MM/DD
According to other sites the 103 format at the end of the line should convert this varchar to UK formatting ( DD/MM/YYYY ).
Can anyone advise why this is not happening?
By default, MSSQL server store dates in
YYYY/MM/DD. You can only change the language on the whole server, not individual databases.run this first before inserting.
or another alternative is to use
SET DATEFORMAT(from MSDN)It should be
VARCHARnotDATE