Hi isomorphic
We are trying to build an advanced criteria dinamically and we have a problem
If we create the criteria like this:
It works but query is understanding stringFecha as a String so database query is
..... AND ((ATBAT_VEHICULOS.FECHA_BAJA IS NULL) OR (ATBAT_VEHICULOS.FECHA_BAJA >= '28/11/2014' AND ATBAT_VEHICULOS.FECHA_BAJA IS NOT NULL)))
So date value has no TO_DATE format
If we try to construct criterion with a date value:
then database query is:
.... AND ((ATBAT_VEHICULOS.FECHA_BAJA IS NULL) OR ('0'='1')))
How should we construct this criterion in order to have a TO_DATE format in database query??
We are using v9.1p_2014-06-11/PowerEdition with Firefox an Internet explorer
Thanks in advance
We are trying to build an advanced criteria dinamically and we have a problem
If we create the criteria like this:
Code:
var fecha = new Date();
var stringFecha = fecha.getDate() + "/" + (fecha.getMonth() +1) + "/" + fecha.getFullYear();
var filtroAvanzado;
if (!UsuarioAutenticado.esUsuarioCTR()) {
filtroAvanzado = {
_constructor: "AdvancedCriteria",
operator: "and",
criteria: [ { fieldName: "IND_TC", operator: "equals", value: "P" },
{ operator: "or", criteria: [ { fieldName: "FECHA_BAJA", operator: "isNull" },
{ fieldName: "FECHA_BAJA", operator: "greaterOrEqual", value: stringFecha }
]
}
]
};..... AND ((ATBAT_VEHICULOS.FECHA_BAJA IS NULL) OR (ATBAT_VEHICULOS.FECHA_BAJA >= '28/11/2014' AND ATBAT_VEHICULOS.FECHA_BAJA IS NOT NULL)))
So date value has no TO_DATE format
If we try to construct criterion with a date value:
Code:
var fecha = new Date();
var filtroAvanzado;
if (!UsuarioAutenticado.esUsuarioCTR()) {
filtroAvanzado = {
_constructor: "AdvancedCriteria",
operator: "and",
criteria: [ { fieldName: "IND_TC", operator: "equals", value: "P" },
{ operator: "or", criteria: [ { fieldName: "FECHA_BAJA", operator: "isNull" },
{ fieldName: "FECHA_BAJA", operator: "greaterOrEqual", value: fecha }
]
}
]
};.... AND ((ATBAT_VEHICULOS.FECHA_BAJA IS NULL) OR ('0'='1')))
How should we construct this criterion in order to have a TO_DATE format in database query??
We are using v9.1p_2014-06-11/PowerEdition with Firefox an Internet explorer
Thanks in advance