| Author |
Topic |
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 13:25:00
|
| Iam just importing data from excel to sqlSELECT emp_id,Grade_obtained,completed_dateFROM [Results$]and the comleted_date is in the format like this (02-Jun-03).Its selecting the rest of the things but the completed_date is always being pulled asNULL though thereis dates |
|
|
surefooted
Posting Yak Master
188 Posts |
Posted - 2004-10-11 : 13:34:51
|
| What is the datatype of the destination column for completed_date?-JonNow a "Yak Posting Veteran". |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 13:36:01
|
| its datetime |
 |
|
|
elwoos
Master Smack Fu Yak Hacker
2052 Posts |
Posted - 2004-10-11 : 13:44:19
|
| How are you importing the data? Can you convert to SQL datetime in the import?steveTo alcohol ! The cause of - and solution to - all of life's problems |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 13:48:32
|
| Before even importing I have a select statement as I have specified above is not selecting date its selecting only NULLS |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 14:46:19
|
| Hi there when I converted the column in the excel to datetime as MM/DD/YY its getting seleting.No how will I use the select the corressponding format to select the data |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-10-11 : 15:01:51
|
| There are dates in SOME of the rows...I bet there is also a header that is confusing it....You need to show us exactly what it looks like in EXCEL...Are you using DTS?Brett8-) |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 15:12:15
|
| In excel the column name is completed_date and some of the rows are empty and some of them have values like 26-Jun-03,02-Jun-03 |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 15:16:27
|
| Iam using DTS as well So its not allowing the cast and convert |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-10-11 : 16:20:25
|
quote: Originally posted by sqllearner In excel the column name is completed_date
Take out the header row, then try it.Did you tell DTS that the first row is a header?Is the first row of data empty?Did you try bcp?Brett8-) |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 17:19:25
|
| The first row of data for the date is empty by but has the rest of the set populated.The interesting part is if I change the excel column to datetime then it pulls the data correctly |
 |
|
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2004-10-11 : 17:38:10
|
| another interesting thing i found was I I insert a date in the 1st row then it picks the rest of them..Is this a bug in DTS |
 |
|
|
|