Re: Search Error in Grid Search Criteria
Why is it when I use DATE fields to search in the QueryBuilder
the system returns the query with quotes
EXAMPLE
Conditons DATE = 10/10/2009
SELECT
CUST_NO,
DATE,
INV_NO,
TRANSACT,
CREDIT,
CREDIT_US
FROM
CPTECLI
WHERE
(DATE = ‘10/10/2009’)
WHEN THE QUERY IS RUN
It returns the following error
odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC dBase Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect | Script: C:Program Files
etmakev5wwwrootscriptcaseprod hirdadodbdriversadodb-odbc.inc.php linha: 540
When I get rid of the quote (DATE = 10/10/2009)
it return an empty set
when I search as follow (DATE >= 10/10/2009)
the system returns the following data which obviously not what the query is requesting from the database
CUST_NO DATE INV_NO TRANSACT CREDIT CREDIT_US
5104 2002-01-03 17987 RET: CER 20X30 98-52 0.0 49.68
5061 2002-01-03 17988 Ventes: REQ/7954/7953/PLYWOOD 0.0 12.20
5037 2002-01-03 17990 Ventes: lat 10 12 16 1x12x16pp… 0.0 2.42
5037 2002-01-03 17991 Ventes: 2X4X10PP 0.0 7.50
5037 2002-01-03 17992 Ventes: DUCO BEIGE GOLD… 0.0 1.10
5037 2002-01-03 17993 Ventes: TOLE PVC 53.46 0.00
Why I am getting these wrong results ?