dbTalk Databases Forums  

Access Date and Time to SQL DateTime

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


Discuss Access Date and Time to SQL DateTime in the microsoft.public.sqlserver.dts forum.



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

Default Access Date and Time to SQL DateTime - 11-15-2004 , 09:30 PM






Greetings All,

I am trying to create an ActiveX Script Transformation in SQL'r 2000
DTS job, getting data from an access database. The data is in 2 fields
- a Status_Date column and a Status_Time column, both of which are
defined as Date/Time in Access. The Stutus_Date column holds only a
date, while the Status_Time holds only a time value.

Using the VBScript statements, I cannot seem to concat the date and
time together and then put the result into the sql table in one
datetime column.

Current attempts at the script are:
DTSDestination("StatusDateTime") = CDate(DTSSource("Status_Date") + '
' + DTSSource("Status_Time"))
DTSDestination("StatusDateTime") =
FormatDateTime(DTSSource("Status_Date") + ' ' +
DTSSource("Status_Time"))
etc

Any help in this matter would be greatly appreciated.

Michael

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

Default Re: Access Date and Time to SQL DateTime - 11-16-2004 , 12:30 AM






Can you not do this in the SourceSQLStatement itself?

I would try to send a string that looks something like

YYYYMMDD HH:MM:SS

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Michael Brandt" <mandl (AT) bigpond (DOT) com> wrote

Quote:
Greetings All,

I am trying to create an ActiveX Script Transformation in SQL'r 2000
DTS job, getting data from an access database. The data is in 2 fields
- a Status_Date column and a Status_Time column, both of which are
defined as Date/Time in Access. The Stutus_Date column holds only a
date, while the Status_Time holds only a time value.

Using the VBScript statements, I cannot seem to concat the date and
time together and then put the result into the sql table in one
datetime column.

Current attempts at the script are:
DTSDestination("StatusDateTime") = CDate(DTSSource("Status_Date") + '
' + DTSSource("Status_Time"))
DTSDestination("StatusDateTime") =
FormatDateTime(DTSSource("Status_Date") + ' ' +
DTSSource("Status_Time"))
etc

Any help in this matter would be greatly appreciated.

Michael



Reply With Quote
  #3  
Old   
Jim Burgess
 
Posts: n/a

Default Re: Access Date and Time to SQL DateTime - 11-17-2004 , 09:20 PM



The following should be what you're looking for:

DTSDestination("StatusDateTime") = DateValue(DTSSource("Status_Date")) &
" " & TimeValue(DTSSource("Status_Time"))





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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.