dbTalk Databases Forums  

Date conversion in DTS

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


Discuss Date conversion in DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Harish Mohanbabu
 
Posts: n/a

Default Date conversion in DTS - 06-13-2005 , 06:46 AM






Hi,

I have created a DTS package for reading data from Excel sheet and copying
them to SQL Server database. Overall it works fine. But I have a query
about date conversion and would be thankful if someone can help me with the
same. Here I go -

In the excel sheet, there are (among other columns) two date fields. Both
these fields have value like -

'Monday 11/04/05' AND 'Thursday 14/04/05'

My query is - How can I convert the above value to SQL datatime in DTS
package itself?

Thanks in advance,

Harish Mohanbabu

Reply With Quote
  #2  
Old   
PaulaPompey
 
Posts: n/a

Default RE: Date conversion in DTS - 06-13-2005 , 08:16 AM






On the transformation line you could run some ActiveX VB script instead of a
straight copy column.

Something like:
FormatDateTime("SOURCE")
or if need be:
FormatDateTime(Right("SOURCE",8))

where "SOURCE" is your source column in the Excel spreadsheet.

Hope this helps

"Harish Mohanbabu" wrote:

Quote:
Hi,

I have created a DTS package for reading data from Excel sheet and copying
them to SQL Server database. Overall it works fine. But I have a query
about date conversion and would be thankful if someone can help me with the
same. Here I go -

In the excel sheet, there are (among other columns) two date fields. Both
these fields have value like -

'Monday 11/04/05' AND 'Thursday 14/04/05'

My query is - How can I convert the above value to SQL datatime in DTS
package itself?

Thanks in advance,

Harish Mohanbabu

Reply With Quote
  #3  
Old   
Harish Mohanbabu
 
Posts: n/a

Default RE: Date conversion in DTS - 06-13-2005 , 08:49 AM



Thank you very much! That's exactly what I was looking for....

"PaulaPompey" wrote:

Quote:
On the transformation line you could run some ActiveX VB script instead of a
straight copy column.

Something like:
FormatDateTime("SOURCE")
or if need be:
FormatDateTime(Right("SOURCE",8))

where "SOURCE" is your source column in the Excel spreadsheet.

Hope this helps

"Harish Mohanbabu" wrote:

Hi,

I have created a DTS package for reading data from Excel sheet and copying
them to SQL Server database. Overall it works fine. But I have a query
about date conversion and would be thankful if someone can help me with the
same. Here I go -

In the excel sheet, there are (among other columns) two date fields. Both
these fields have value like -

'Monday 11/04/05' AND 'Thursday 14/04/05'

My query is - How can I convert the above value to SQL datatime in DTS
package itself?

Thanks in advance,

Harish Mohanbabu

Reply With Quote
  #4  
Old   
PaulaPompey
 
Posts: n/a

Default RE: Date conversion in DTS - 06-13-2005 , 09:21 AM



No probs.

Please set your question status to show it's been sorted.

"Harish Mohanbabu" wrote:

Quote:
Thank you very much! That's exactly what I was looking for....

"PaulaPompey" wrote:

On the transformation line you could run some ActiveX VB script instead of a
straight copy column.

Something like:
FormatDateTime("SOURCE")
or if need be:
FormatDateTime(Right("SOURCE",8))

where "SOURCE" is your source column in the Excel spreadsheet.

Hope this helps

"Harish Mohanbabu" wrote:

Hi,

I have created a DTS package for reading data from Excel sheet and copying
them to SQL Server database. Overall it works fine. But I have a query
about date conversion and would be thankful if someone can help me with the
same. Here I go -

In the excel sheet, there are (among other columns) two date fields. Both
these fields have value like -

'Monday 11/04/05' AND 'Thursday 14/04/05'

My query is - How can I convert the above value to SQL datatime in DTS
package itself?

Thanks in advance,

Harish Mohanbabu

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.