dbTalk Databases Forums  

Migrate DATETIME field in DTS via excel in SQL Server 2000

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


Discuss Migrate DATETIME field in DTS via excel in SQL Server 2000 in the microsoft.public.sqlserver.dts forum.



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

Default Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-18-2008 , 03:38 PM






I've created a DTS package in SQL Server 2000 Enterprise Manager to
export the data in a table that has datetime fields using Task->Export
Data. I've specified Excel 97-2000 as the destination file for the
export, and I've let the dts export wizard configure the mappings.

When I run the package, the table gets exported, but all the datetime
fields in the spreadsheet have the time part truncated off - only the
date appears in the spreadsheet. How can I get the wizard to include
the time portion of the datetime fields?

Andy

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

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM






I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

Reply With Quote
  #3  
Old   
Andy
 
Posts: n/a

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM



I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

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

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM



I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

Reply With Quote
  #5  
Old   
Andy
 
Posts: n/a

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM



I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

Reply With Quote
  #6  
Old   
Andy
 
Posts: n/a

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM



I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

Reply With Quote
  #7  
Old   
Andy
 
Posts: n/a

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM



I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

Reply With Quote
  #8  
Old   
Andy
 
Posts: n/a

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM



I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

Reply With Quote
  #9  
Old   
Andy
 
Posts: n/a

Default Re: Migrate DATETIME field in DTS via excel in SQL Server 2000 - 03-20-2008 , 10:01 AM



I found that the time part isn't really truncated off during a DTS
migration when using an Excel spreadsheet as a transport vehicle. By
default, the date columns of the spreadsheet DTS creates are set to
display the date part of the datetime value. By selecting the date
column, and right clicking and selecting format cells, you can select
a time format that will display the datetime with both date and time
parts. If you save the spreadsheet in excel after this, you will also
be able to see the date/time values in Microsoft's Excel viewer.

If you are finding that DTS seems to migrate the dates okay, but not
the times, then the problem you may be experiencing is that the dates
are saved as GMT times, and you need to use timezones to read/write
the exported date data. Read about the .NET TimeZone and TimeSpan
functions in Visual Studio .NET's help file. These functions allow
your code to determine the timezone used on the computer the export
data arrived to, and expose a getUTCOffset method which returns an
offset which you can add to the date to adjust it for your timezone.

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.