Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
denfer
Starting Member
12 Posts |
Posted - 2009-03-31 : 09:04:20
|
| HiI have a date String 'Feruary 13th, 2009' that I want to convert to Date.I tryed several way without any successdo you have any idea if this kind of string can be converted/Cast to DateTime ? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-03-31 : 09:13:10
|
[code]DECLARE @Sample VARCHAR(200)SET @Sample = 'February 13th, 2009'SELECT @Sample, CAST(REPLACE(@Sample, 'th', '') AS DATETIME)[/code] E 12°55'05.63"N 56°04'39.26" |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-31 : 09:20:43
|
| you also might want to add replacements for 'st','rd','nd'.. |
 |
|
|
denfer
Starting Member
12 Posts |
Posted - 2009-03-31 : 09:22:14
|
| Thanks a lot for your helpI didn't noticed the missing 'b' |
 |
|
|
|
|
|