![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I have a dts package that uses SQL to get data from a DB2 database. How can use variables within the dts SQL? I need to have the SQL Server equivilent of this in the dts Declare @CurrentMonth as varchar(15) Declare @NextMonth as varchar(15) Set @CurrentMonth = Cast(Month(DateAdd(m,-1,getDate()))as varchar(2)) + '/01/' + Cast(Year(DateAdd(m,-1,getDate()))as varchar(4)) Set @NextMonth = DateAdd(m,1,@CurrentMonth) The above code isn't working when I add it to the dts SQL statement. thanks, mike w. |
![]() |
| Thread Tools | |
| Display Modes | |
| |