I am having a difficult time converting a method from version 5 to version 6. Following is the code:
- Code: Select all
var uniT = unit;
var arrive = utils.dateFormat(arr_date,'MM/dd/yyyy');
var depart = utils.dateFormat(dep_date,'MM/dd/yyyy');
var resNum = res_num;
var query = 'SELECT res_num FROM reservations WHERE res_num= ? AND status= ? AND unit = ? AND \
((arr_date<=? AND dep_date > ? AND dep_date <= ?) OR \
(arr_date >= ? AND arr_date< ? AND dep_date >= ?) OR \
(arr_date <= ? AND dep_date >= ?) OR (arr_date >= ? AND dep_date <= ?))';
var args = new Array(); args[0] = resNum; args[1] = 'Active'; args[2] = uniT; args[3] = arrive;
args[4] = 'arrive'; args[5] = depart; args[6] = arrive; args[7] =depart; args[8] =depart;
args[9] = arrive; args[10] = depart; args[11] = arrive; args[12] =depart;
var dataset = databaseManager.getDataSetByQuery(globals.server,query,args,-1);
The error is:
ERROR: operator does not exist: timestamp without time zone > character varying
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Position: 116
Wrapped java.lang.RuntimeException: com.servoy.j2db.dataprocessing.DataException: ERROR: operator does not exist: timestamp without time zone > character varying
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Position: 116 (/Users/TPG/servoy_workspace/TWF_Database/forms/Reservations.js#1565)
Right now I am not understanding the why or how of type casts.
Thanks for the help.