Avatar of ScuzzyJo
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

SQL Server 2014 Management Studio Trouble with Dates

Hi.  My question relates to SQL Server 2014 Management Studio.  I'm having trouble with dates.  The files I'm using are imported from Excel, but were downloaded from SAS Enterprise Guide prior to this.

One of the files has a column called GLPDate.  In Excel, this shows perfectly, e.g. 17/03/2015.  Once I've imported it, it converts to an American date, e.g. 2015-03-17.  I've tried using SET DATEFORMAT dmy; but that has no effect.  It's showing as a smalldatetime.

How can I get this to a British format?

Also, the other file has the correct format, but I need to concatenate it with another field.  When I do so, it goes from, e.g. 5093865 (1st column which is not a date) and 28/12/2012 00:00 (2nd column, which is a datetime) to 50936865Dec 28 2012 12:00AM.  This is driving me crazy!

Microsoft SQL Server

Avatar of undefined
Last Comment

8/22/2022 - Mon