Does anyone know what I can do to load a foundset via controller.loadRecords(sqlstring, params); where the parameter is a date field and we want the dates to be say the last 24 hours, 3 days, 1 week or 30 days?
our code passes something like ‘sysdate-1’ as the parameter.
This worked in 5.2.7 but now fails in both 5.2.8 and 5.2.9 versions of servoy
Server Information
Servoy version 5.2.9 -build 1020
Port used by RMI Registry: 1099
Repository version 38
Firefox 3.6.16
Tested O/S: Windows 7 and XP and linux application servers
sysdate -1 still has a time component.
You should remove that or use a from datetime1 to datetime2
Regards,
Ernest
When you call foundset.loadrecord(sql, parms) the question marks in the sql are replaced with the values passed in, a value ‘sysdate-30’ will be interpreted as string, not as a special function of the db.
This has never worked before.
You can call db-specific functions with custom sql like this:
foundset.loadrecords(‘select order_id from orders where priority <> ? and row_created_date >= sysdate-30 and row_created_by = ?’, [‘5’, ‘ernest’])
Rob
Rob,
Thanks I will take a look at the code and remove it as a parameter being passed.
Ernest