edwardturner
Technical User
Hello,
I have a DTS that convert dates from a text file into dates to be held in SQL Server.
The source file dates are like so:
05OCT06
Therefore in my DTS I do the following conversion:
arrMonth = mid(DTSSource("Col003"),3,3)
if arrMonth = "DEC" then
arrMonth = "12"
elseif arrMonth = "JAN" then
arrMonth = "01"
I then use this to build the date into a UK date format valid for SQL Server:
CDate(left(DTSSource("Col003"),2) + "/" + arrMonth +
"/20" + mid(DTSSource("Col003"),6,2))
This is fine as I have used msgbox to output this during the transformation and the dates and being built ok.
However, when stored in SQL Server the month and day and being switched but only where it would be a valid american date, e.g. 05OCT06 becomes May 10th and October 5th.
Does anyone know why this might be happening. Is a setup issue in SQL Server? I am using SQL 2000 SP4.
I have a DTS that convert dates from a text file into dates to be held in SQL Server.
The source file dates are like so:
05OCT06
Therefore in my DTS I do the following conversion:
arrMonth = mid(DTSSource("Col003"),3,3)
if arrMonth = "DEC" then
arrMonth = "12"
elseif arrMonth = "JAN" then
arrMonth = "01"
I then use this to build the date into a UK date format valid for SQL Server:
CDate(left(DTSSource("Col003"),2) + "/" + arrMonth +
"/20" + mid(DTSSource("Col003"),6,2))
This is fine as I have used msgbox to output this during the transformation and the dates and being built ok.
However, when stored in SQL Server the month and day and being switched but only where it would be a valid american date, e.g. 05OCT06 becomes May 10th and October 5th.
Does anyone know why this might be happening. Is a setup issue in SQL Server? I am using SQL 2000 SP4.