Hi all the clever people
I have set up the following three variables that I want to use in a for loop container:
Counter Scope= For Loop Container DataType = DateTime
EndDate Scope= For Loop Container DataType = DateTime
StartDate Scope= For Loop Container DataType = DateTime
InitExpression @[User::Counter] = @[User::StartDate]
EvalExpression @[User::Counter] < @[User::EndDate]
AssignExpression @[User::Counter] = dateadd("d",1,@[User::Counter])
I have the following code that I want to use in Startdate:
(TrxDateNumeric is defined as a smalldatetime variable in our database - it cannot be changed for various reasons)
from dbo.BI1_View_Dim_CalendarDefinition WITH (NOLOCK)
inner join dbo.BI1_View_Dim_SystemParameters WITH (NOLOCK)
on Run_Type = ''SALES''
where TrxDate = RUN_DateHistoryFrom
TrxDateNumeric is set to the first of the month for the current month, which is what I want to store in StartDate, but I get an error is SSIS (the code as is here works in the db and is what I want).
Is there anyone that can assist me with this? I am a bit new to ssis.