OK So for the date that's easy
You can parse the value you get in and make it into a format SQL Server
understands
One example would be to use this
Formatting Character Data into Datetime fields
(http://www.sqldts.com/default.aspx?249)
SQL Server likes certain formats and will never misinterpret them so if you
can arrange your source to look like that then you are cooking.
Example
DECLARE @d char(10)
DECLARE @t char(5)
SET @d = '20/12/2004'
SET @t = '12:09'
select CAST(@d + ' ' + @t as datetime)
You do not offer examples of what your dates look like so I cannot offer a
real example. Have you tried anything?
--
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know
"Andrew Grandison" <andrewgrandison (AT) hotmail (DOT) com> wrote
Quote:
Hi,
I am trying to work out how to script (as part of a transform data
task) the conversion of a date field and a time field (a char(5) field
with, for example, "14:30") from a foxpro 2.6 table and combine them
to form a datetime field for the DTS destination field.
Maybe even some indication of the VBScript functions I should look at
using.
I have no VBScript experience.
Any help appreciated.
Thankyou,
Andrew |