Due to a software package we use's way of managing it's database, it seems to use a nvarchar(50) field for it's date... unsure why, but anyway.
In one of the fields, it stores two different formats for dates being:
13 January 2010 09:15:37
and also:
Wednesday, 13 January 2010 11:48:44pm
When i attempt a convert or a cast, i get an errors such as the the following:
Msg 295, Level 16, State 3, Line 1
Conversion failed when converting character string to smalldatetime data type.
Now obviously this is because it doesn't like the two different date formats.. does anyone have any idea how this can be done?? as the original software cannot be changed, however there must be a way to convert or cast?
Question
crashguy
Hi Guys,
Hoping someone can help me.
Due to a software package we use's way of managing it's database, it seems to use a nvarchar(50) field for it's date... unsure why, but anyway.
In one of the fields, it stores two different formats for dates being:
13 January 2010 09:15:37
and also:
Wednesday, 13 January 2010 11:48:44pm
When i attempt a convert or a cast, i get an errors such as the the following:
Msg 295, Level 16, State 3, Line 1
Conversion failed when converting character string to smalldatetime data type.
Now obviously this is because it doesn't like the two different date formats.. does anyone have any idea how this can be done?? as the original software cannot be changed, however there must be a way to convert or cast?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts