1
0
-1

If I have selected box contains Month (January to December) using jdbc binder, how do I control to select only 3 month before included current month? Means, only allow to select October (current Month), September and August.

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi Andrew,

      Thanks!. It works..

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Rosadilla

        In your Selectbox SQL query in JDBC Binder, you can use the Date Hash Variable #date.M# to return the current system month and add this into your SQL WHERE clause. You can also use the #date.MONTH-x.M# syntax to perform some simple calculation.

        For example, assuming you stored your months lookup records in table "app_fd_yearsetup" as follows:

        c_number     c_month

        8                   Aug
        9                   Sep
        10                 Oct

        This example SQL will filter to show only Aug, Sep and Oct in your selectbox.

        SELECT c_number, 
               c_month 
        FROM   app_fd_yearsetup 
        WHERE  (c_number = '#date.MONTH-2.M#' 
                OR c_number = '#date.MONTH-1.M#' 
                OR c_number = '#date.M#' ) 

        Hope this helps.

          CommentAdd your comment...