question

drix07 avatar image
drix07 asked

How to get yesterday's date using ActiveXScript in SSIS

I have this script in activeX but i am encountering this error message when i ran the package, can anyone please help me on this? i am a newbie in SSIS, thanks!! Function Main() Main = DTSTaskExecResult_Success DTSGlobalVariables("User::src_date").Value ="(DT_STR,4,1252)YEAR(DATEADD("dd", -1, GETDATE())) + RIGHT("0" + (DT_STR,2,1252)MONTH(DATEADD("dd", -1, GETDATE())),2) + RIGHT("0" + (DT_STR,2,1252)DAY(DATEADD("dd", -1, GETDATE())),2)"" End Function
ssisdate
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image KenJ commented ·
Which error message are you encountering?
0 Likes 0 ·

1 Answer

·
KenJ avatar image
KenJ answered
I don't have the DTS 2000 runtime installed to try your particular script. If you want to use an SSIS script task (.net), you can try the following: Dts.Variables["User::src_date"].Value = DateTime.Now.Subtract(new TimeSpan(1)).ToShortDateString();
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.