Find on a Date

Sorry but am new to this, but when performing the search to get future date records I always get nothing returned, process_date is a MySQl datetime.

var l_curr_date = application.getDateStamp();
var search_date = utils.dateFormat(l_curr_date,‘yyyy/MM/dd’)

forms.frm_list_current.controller.find()
forms.frm_list_current.process_date > ‘#’+search_date + ‘|yyyy/MM/dd’;
var found = forms.frm_list_current.controller.search()

Ok solved it by adding to the form onShow:

var query = ‘select order_id from orders where order_date >=’
var search_date = utils.dateFormat(l_curr_date,‘yyyy/MM/dd’)
query = query + " ‘" + search_date + "’ "

forms.frm_orders_current.foundset.clear()
forms.frm_orders_current.controller.loadRecords(query)

When using SQL, it is much better to use a prepared statement for this, because especially with dates, the syntax differs between databases and a prepared statement can be precompiled on the database server. Try this:

var query = 'select order_id from orders where order_date >= ?'
forms.frm_orders_current.controller.loadRecords(query, [application.getDateStamp()]);

The second parameter of loadRecords takes an array that needs to provide the values for the ? parameters. So if you do

SELECT abc FROM table WHERE def = ? AND hij = ? AND klm = ?

you need to provide an array with three values.