4 Replies Latest reply: Jul 1, 2015 6:45 AM by Matthew Bryant RSS

    Creating a Variable for the Max Date

    Matthew Bryant

      I have a script that creates a table of all dates from file names, and I am trying to create a variable from this list to pick out the max date:

       

       

      For Each vFile in FileList('\D_OO_*.qvd')

      FileDates:
      Load

      Date(Date#(Left(Right('$(vFile)',12),8),'YYYYMMDD'),'DD/MM/YYYY') as [DOO File Date]

      autogenerate(1);

      Next vFile;


      LET vStatisticDate = max([DOO File Date]);

       

      My problem is that for some reason the variable vStatisticDate is null, but when I use the exact same expression after the Load I have no problems. What am I doing wrong?