Selected Box validation

Confluence User - 17 Oct, 2017

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.

selectbox

2


17 Oct, 2017
confluenceUser
confluenceUser

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.

25 Oct, 2017
confluenceUser
confluenceUser

Hi Andrew,

Thanks!. It works..

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print