I'm having a little trouble with the logic in SSIS For Loop Container
Variables:
- @FileModDt - The modified date of a file (read by a Task Factory step in the loop)
- @OldestDateAllowed - Oldest date allowed for a file
- @Loops
- @LoopCounter
If I use this expression it works well looking for a file newer than @OldestDateAllowed. If the file is newer than @OldestDateAllowed, it will proceed:
@FileModDt <= @OldestDateAllowed
If I use this expression it will loop the number of times as the value of @Loops and finish:
@LoopCounter < @Loops
The issue is I want to combine them. I'm trying to do this: If the file is too old, loop back through, BUT after 5 loops, quit andsomething (throw an error or send an email).
I can't figure out how to set that in the container's EvalExpression logic.
Neither of these work.
(@FileModDt <= @OldestDateAllowed || @LoopCounter < @Loops)(@FileModDt <= @OldestDateAllowed && @LoopCounter < @Loops)
-Al H