dbTalk Databases Forums  

Import Time Column From Excel

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Import Time Column From Excel in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Wayne Wengert
 
Posts: n/a

Default Import Time Column From Excel - 04-01-2005 , 09:07 AM






I have an Excel 2003 spreadsheet that includes a column of times (e.g. 9:08
AM, 10:15 PM, etc). I want to import that into a SQL Server table. I tried
using a transformation with CDATE but the import still blows up trying to
import that time field - Is there a way to do this?

TIA

Wayne



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Import Time Column From Excel - 04-02-2005 , 12:52 AM






Because the smalldatetime and the datetime datatypes must also have a
date portion we must do something like this

Function Main()

DTSDestination("MyTime") = "1/1/1900 " & DTSSource("MyTime")

Main = DTSTransformStat_OK
End Function




"Wayne Wengert" <wayneDONTWANTSPAM (AT) wengert (DOT) com> wrote


Quote:
I have an Excel 2003 spreadsheet that includes a column of times (e.g. 9:08
AM, 10:15 PM, etc). I want to import that into a SQL Server table. I tried
using a transformation with CDATE but the import still blows up trying to
import that time field - Is there a way to do this?

TIA

Wayne


Reply With Quote
  #3  
Old   
Wayne Wengert
 
Posts: n/a

Default Re: Import Time Column From Excel - 04-02-2005 , 09:02 AM



Allan;

Thanks for that information. Makes sense. I'll give that a try.

Wayne

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Because the smalldatetime and the datetime datatypes must also have a
date portion we must do something like this

Function Main()

DTSDestination("MyTime") = "1/1/1900 " & DTSSource("MyTime")

Main = DTSTransformStat_OK
End Function




"Wayne Wengert" <wayneDONTWANTSPAM (AT) wengert (DOT) com> wrote in message
news:wayneDONTWANTSPAM (AT) wengert (DOT) com:

I have an Excel 2003 spreadsheet that includes a column of times (e.g.
9:08
AM, 10:15 PM, etc). I want to import that into a SQL Server table. I
tried
using a transformation with CDATE but the import still blows up trying
to
import that time field - Is there a way to do this?

TIA

Wayne




Reply With Quote
  #4  
Old   
Simon Worth
 
Posts: n/a

Default Re: Import Time Column From Excel - 04-02-2005 , 01:40 PM



Is there another column that contains the date as well? If there isn't
I guess you'll just have to make one up.

Simon Worth

Wayne Wengert wrote:
Quote:
I have an Excel 2003 spreadsheet that includes a column of times (e.g. 9:08
AM, 10:15 PM, etc). I want to import that into a SQL Server table. I tried
using a transformation with CDATE but the import still blows up trying to
import that time field - Is there a way to do this?

TIA

Wayne



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.