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 |
IKU
Starting Member
11 Posts |
Posted - 2009-07-08 : 13:12:18
|
Hi, I need to convert character field into date. Field I need to convert is originaly from txt file and has a format 09.01.2006, now I need to get it in standard sql date format to insert it into date field in my database (2006-01-09).Does anyone know how to do this, since I have only converted date to char and never char to date.Thank you |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-08 : 13:20:36
|
you can use CONVERT. try something likeSELECT CONVERT(datetime,yourfield,104) |
|
|
IKU
Starting Member
11 Posts |
Posted - 2009-07-08 : 13:30:50
|
Thank you it's working I've missed format, haven't tried 104, but 120 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-08 : 13:32:42
|
ok. welcome |
|
|
|
|
|