4 Replies Latest reply: Jun 9, 2016 7:03 AM by Herbert van Hoogdalem RSS

    For loops, start/end dates and keytables

    Herbert van Hoogdalem

      Hi everyone,

       

      I have the foloowing table (simplified of course):

       

      CodeFROM_dateTO_dateManager
      10001 - 01 - 201603 - 01 - 2016Hank
      10101 - 01 - 201605 - 01 - 2016Edward

       

      Now what i want to make is the following table

       

      DAY-CODE-KEYManager
      01-01-2016-100Hank
      02-01-2016-100Hank
      03-01-2016-100Hank
      01-01-2016-101Edward
      02-01-2016-101Edward
      03-01-2016-101Edward
      04-01-2016-101Edward
      05-01-2016-101Edward

       

      So basically i want to load each row in the top-table and then use a FOR-loop to create rows in a new table.

       

      I was thinking to loop through the lines, then set two vars with peek (from and to), and then loop from 'from' to 'to' and create the lines in table 2.

       

      Am I thinking in the wrong direction? Cause I can't seem to nest two for statements....

       

      Kind regards,

       

      Herb