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 |
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2006-12-14 : 02:58:32
|
I need to import a datatime field from other source.However, with followings statement, the first one runs ok but the second one failure.select datename(mm, '14/12/2006') from systabselect datename(mm, '12/14/2006') from systabWhich thing in SQL 2000 control the datetime import criteria? What's the best practice to handle this? |
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2006-12-14 : 03:02:09
|
Use YYYY-MM-DD or YYYYMMDDDuane. |
|
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2006-12-14 : 03:12:26
|
sorry, I don't understand. What factors control the date format for import?Just run following script and get these errors.select datename(mm, '20061212') from systabselect datename(mm, '20061214') from systabselect datename(mm, '20061412') from systab (Not working)select datename(mm, '2006-12-12') from systabselect datename(mm, '2006-12-14') from systab (Not working)select datename(mm, '2006-14-12') from systab |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-14 : 05:57:07
|
Read about SET DATEFORMAT in Books Online.Peter LarssonHelsingborg, Sweden |
|
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2006-12-14 : 21:13:41
|
Thx Peso,the help file is very clear and easy to understand. |
|
|
|
|
|
|
|