![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am trying to load an excel file into a table in mssql and was having problems. My excel file is in the following format: ID Name TermDate 1 JB '01/25/2006' 2 Jake ' ---' 3 Smith '05/28/2006' 4 Halal ' ---' When I try to execute my DTS script (below), I the TermDate column in the table show NULL. Any help would be greatly appreciated. Thank you. Rick.. Function Main() DTSDestination("EmpID") = DTSSource("ID") DTSDestination("Name") = DTSSource("Name") DTSDestination("TermDate") = DTSSource("TermDate") dim i_Day dim i_Month dim i_Year If len(DTSSource("Term Date")) = 10 Then i_Day = Cint(Mid( DTSSource("Term Date") , 4 , 2 )) i_Month = Cint(Mid( DTSSource("Term Date") , 1, 2 )) i_Year = Cint(Left(DTSSource("Term Date"), 4)) DTSDestination("TermDate") = DateSerial( i_Year , i_Month ,i_Day ) Else DTSDestination("TermDate") = Null End If Main = DTSTransformStat_OK End Function |
![]() |
| Thread Tools | |
| Display Modes | |
| |