3 Replies Latest reply: Jun 16, 2016 8:47 AM by Leonardo Camacho RSS

    Problem with dates in selections for script

    Leonardo Camacho

      Good afternoon,

       

      any suggestions why below scripts fails with message "Garbage after statement"?

       

      Thanks!

       

       

      SET ThousandSep='.';
      SET DecimalSep=',';
      SET MoneyThousandSep='.';
      SET MoneyDecimalSep=',';
      SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
      SET TimeFormat='hh:mm:ss';
      SET DateFormat='DD.MM.YYYY';
      SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
      SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
      SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';


      set DayForSelection = 23.05.2016;


      Directory;
      LOAD
      Personalnr as Personalnummer,
      // [Gültig bis],
      // [Gültig ab],
         [ID/Nummer] as UserID
      FROM
      PA0105.xls
      (
      txt, unicode, embedded labels, delimiter is '\t', msq, header is 3 lines, no eof) where [Gültig ab] < $(DayForSelection)  and  $(DayForSelection) <=  [Gültig bis];

        • Re: Problem with dates in selections for script
          Sunny Talwar

          Can you try this:

           

          SET ThousandSep='.';
          SET DecimalSep=',';
          SET MoneyThousandSep='.';
          SET MoneyDecimalSep=',';
          SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
          SET TimeFormat='hh:mm:ss';
          SET DateFormat='DD.MM.YYYY';
          SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
          SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
          SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';

           


          SET DayForSelection = 23.05.2016;


          Directory;
          LOAD
          Personalnr as Personalnummer,
          // [Gültig bis],
          // [Gültig ab],
            [ID/Nummer] as UserID
          FROM
          PA0105.xls
          (txt, unicode, embedded labels, delimiter is '\t', msq, header is 3 lines, no eof) where [Gültig ab] < '$(DayForSelection)'   and  '$(DayForSelection)' <=  [Gültig bis];

            • Re: Problem with dates in selections for script
              Sunny Talwar

              Or may be this:

               

              SET ThousandSep='.';
              SET DecimalSep=',';
              SET MoneyThousandSep='.';
              SET MoneyDecimalSep=',';
              SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
              SET TimeFormat='hh:mm:ss';
              SET DateFormat='DD.MM.YYYY';
              SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
              SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
              SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';

               

              SET DayForSelection = Num(MakeDate(2016, 5, 23));


              Directory;
              LOAD
              Personalnr as Personalnummer,
              // [Gültig bis],
              // [Gültig ab],
                [ID/Nummer] as UserID
              FROM
              PA0105.xls
              (txt, unicode, embedded labels, delimiter is '\t', msq, header is 3 lines, no eof) where [Gültig ab] < $(DayForSelection)  and  $(DayForSelection) <=  [Gültig bis];