I am trying to execute a stored proc with DTS (SQL 2000) in a SQL task. My problem is in trying to set one of the parameters with a variable. My script from the SQL task is below.
declare @CutOffDate as datetime
set @CutOffDate = convert(char(10),dateadd(day,-1*datepart(day,getdate()),getdate()),101)
exec SAIspGetHATBDataDTS;1 ?,?,@CutOffDate,?,?,?
Basically, this just tries to set a date param to the end of the previous month as calculated by todays date. This works OK if I just create a global variable and assign another ?, but I can't seem to force this global vairable to my date even if I run it outside of this task.
Thanks for looking.
declare @CutOffDate as datetime
set @CutOffDate = convert(char(10),dateadd(day,-1*datepart(day,getdate()),getdate()),101)
exec SAIspGetHATBDataDTS;1 ?,?,@CutOffDate,?,?,?
Basically, this just tries to set a date param to the end of the previous month as calculated by todays date. This works OK if I just create a global variable and assign another ?, but I can't seem to force this global vairable to my date even if I run it outside of this task.
Thanks for looking.