Saturday, February 25, 2012

Newbie - DTS Transformation Task

Hi all,

I have a problem. I am running a Transform Data Task between 2
sqlserver tables on the same database. Most of the transformations are
straight copy columns. However there are a few that require an entry
corresponding to a datediff between 2 dates in the source table.

I can't get this to work. I have no idea how to do it basically. Here
is what i'm trying to do but it generates all sorts of errors.

DTSDestination("column") = datediff(mi, DTSSource("column1"),
DTSSource("Column2"))

I'm sure this is fundamentally incorrect somewhere. I really don't
know what to do, I can pull the datediff value fine in Query anlyser
with this...

datediff(mi, convert(datetime, dateval1, 103), convert(datetime,
[dateval2], 103)) as RestoreTime

but that doesnt work in the activex script either.

Any help or pointers would be greatly appreciated.
Thanks all.Hi

I am not sure if mi is a valid unit type in VBScript, and it should be in
quotes!

http://msdn.microsoft.com/library/d...xconversion.asp

John

"Mirth1314" <not@.ahope.net> wrote in message
news:2av9lvsh4p0dglsunonm37rorhfo6tkimm@.4ax.com...
> Hi all,
> I have a problem. I am running a Transform Data Task between 2
> sqlserver tables on the same database. Most of the transformations are
> straight copy columns. However there are a few that require an entry
> corresponding to a datediff between 2 dates in the source table.
> I can't get this to work. I have no idea how to do it basically. Here
> is what i'm trying to do but it generates all sorts of errors.
> DTSDestination("column") = datediff(mi, DTSSource("column1"),
> DTSSource("Column2"))
> I'm sure this is fundamentally incorrect somewhere. I really don't
> know what to do, I can pull the datediff value fine in Query anlyser
> with this...
> datediff(mi, convert(datetime, dateval1, 103), convert(datetime,
> [dateval2], 103)) as RestoreTime
> but that doesnt work in the activex script either.
> Any help or pointers would be greatly appreciated.
> Thanks all.

No comments:

Post a Comment