2 Replies Latest reply: May 6, 2015 9:40 AM by b. h. RSS

    How to create a variable for a special date

    b. h.

      I need to read a table within the last week, I am looking for something like:

      LET vStartdate = '01.05.2015';

      LET vEnddate = '08.05.2015';

       

      LOAD  CreatedAt WHERE CreatedAt >= $(vStartdate) AND CreatedAt <= '08.05.2015';

       

      ---------------------------

      Return of terminal was that the error was here:

      LOAD  CreatedAt WHERE CreatedAt >= 01.05.2015 AND CreatedAt <= '08.05.2015'

       

       

      I found this, but I am not sure how to fix it:

      The cause is that $(vStartdate) returns a string. The result is that you compare a numeric month value (because of the >= operator) with a string value. By changing the variable so that it return a number it's possible to use the >= and <= operators. To make the first part of the chart expression work I changed the modifier so it works with the number value of the variable.


      Please help. Thank you in advance.