6 Replies Latest reply: May 31, 2011 10:49 AM by mace2011 RSS

    Conditions in the script and filters

      Sorry for another newcomer question, but I could not find this when I searched.


      I have a lot of old data that is no longer relevant.


      I would like to only load or show records with a date in 2010 or 2011.


      Question no1:

      Can I do this when I load the data? Can I do it in the SELECT statement and what would be the correct syntax (SQL?)?

      (kind of Select * from SALES where SALES_DATE > 2009-12-31, but this does syntax does not seem to work)


      Question no 2:

      How can I filter in a Listbox so that it only shows some values? For example, if I want a SALES_DATE listbox to only show the dates for 2010 and 2011, so that people can not pick something older that this? Is it possible?




      These are probably really basic questions, and it bugs me that I do not find an answer.

        • Conditions in the script and filters
          Erich Shiino

          For the first question, SQL Syntax could be like this:

          Select * from SALES where SALES_DATE > '2009-12-3' if that's your correct date format.

          or  Select * from SALES where year(SALES_DATE)>=2010



          for the second question, you could use and expression instead of a field. Then, your expression could be something like this:

          = if(  SALES_DATE>=makedate(2010), SALES_DATE)

          The problem is: if you create a date-based chart, this expression on a list will not prevent the data from showing on the chart for 2009, for example. You would have to change all the expressions for that.


          It`s better to solve it with question 1, because you application will use less memory and have better performance.


          Hope it helps,