Very Strange. Date parameter binding does not work sometimes on OraQuery.
Posted: Fri 09 Feb 2007 10:28
Hello there. I have very strange problem. I am using Delphi 2006 and ODAC 5.70.028.
I have following query in my OraQuery's SQL property.
select *
from mpos_transaction
where create_date between TO_DATE(:date1,'DD.MM.YYYY') AND
TO_DATE(:date2,'DD.MM.YYYY')
and i am trying to bind two date parameters by selecting from the form DateTimePicker component like this:
OraQuery1.Close;
OraQuery1.ParamByName('date1').asDate := cxDateEdit1.Date;
OraQuery1.ParamByName('date2').asDate := cxDateEdit2.Date;
OraQuery1.Open
although this query does not return any rows, if i dont use any parameter and directly enter the SQL into OraQuery, some rows return. Like that :
select *
from mpos_transaction
where create_date between TO_DATE('01.02.2007','DD.MM.YYYY') AND
TO_DATE('09.02.2007','DD.MM.YYYY')
Please note that i am sure that i am selecting same dates using DateTimePicker component and I am sure that there are rows between that date interval.
Besides I try that in other computers and i see that on some of the computers it is working very well. (All OS English Win2003).
Any suggestions ? I have look over the regional setting of thouse computers and they are all same. What can be the problem ??
Thanx for helping.
I have following query in my OraQuery's SQL property.
select *
from mpos_transaction
where create_date between TO_DATE(:date1,'DD.MM.YYYY') AND
TO_DATE(:date2,'DD.MM.YYYY')
and i am trying to bind two date parameters by selecting from the form DateTimePicker component like this:
OraQuery1.Close;
OraQuery1.ParamByName('date1').asDate := cxDateEdit1.Date;
OraQuery1.ParamByName('date2').asDate := cxDateEdit2.Date;
OraQuery1.Open
although this query does not return any rows, if i dont use any parameter and directly enter the SQL into OraQuery, some rows return. Like that :
select *
from mpos_transaction
where create_date between TO_DATE('01.02.2007','DD.MM.YYYY') AND
TO_DATE('09.02.2007','DD.MM.YYYY')
Please note that i am sure that i am selecting same dates using DateTimePicker component and I am sure that there are rows between that date interval.
Besides I try that in other computers and i see that on some of the computers it is working very well. (All OS English Win2003).
Any suggestions ? I have look over the regional setting of thouse computers and they are all same. What can be the problem ??
Thanx for helping.