Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS For Loop Container logic for multiple conditions

$
0
0

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



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>