Apache OpenOffice (AOO) Bugzilla – Issue 18594
ADO/MDB Prompted Query Incorrect for a Date Range
Last modified: 2006-05-31 14:29:06 UTC
This problem pertains to an ADO datasource accessed via the following URL: sdbc:ado:Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Common Files\ODBC\Data Sources\FINANCE.mdb;Mode=Share Deny None;Persist Security Info=False Suppose you have a table like this: CREATE TABLE CHECKS ("RECID" INTEGER PRIMARY KEY, "POSTEDDATE" DATETIME NOT NULL, "PAYEE" VARCHAR(40) NOT NULL, "BANKTRACE" INTEGER DEFAULT NULL, "TRANDATE" DATETIME DEFAULT NULL, "VENDTRACE" INTEGER DEFAULT NULL, "AMOUNT" MONEY NOT NULL, "MEMO" VARCHAR(40) DEFAULT NULL ) In the Query Designer make a query that results in the following SQL: SELECT `POSTEDDATE`, `PAYEE`, `BANKTRACE`, `TRANDATE`, `VENDTRACE`, `AMOUNT`, `MEMO` FROM `CHECKS` `CHECKS` WHERE ( ( `POSTEDDATE` >= {D '2003-07-01' } AND `POSTEDDATE` <= {D '2003-07-31' } ) ) ORDER BY `POSTEDDATE` ASC That produces correct results. Now, change it to a prompted query like this: SELECT `POSTEDDATE`, `PAYEE`, `BANKTRACE`, `TRANDATE`, `VENDTRACE`, `AMOUNT`, `MEMO` FROM `CHECKS` `CHECKS` WHERE ( ( `POSTEDDATE` >= :sDate AND `POSTEDDATE` <= :eDate )) ORDER BY `POSTEDDATE` ASC Respond to the prompt with 7/1/03 and 7/31/03. (I'm in USA so that's M/D/YY) Now, the result is only 2 rows with with POSTEDDATE of 7/31/03. Note also that a response in the form YYYY-MM-DD is not accepted. I think that too is a bug. Also note that that Query Designer will not accept the more obvious BETWEEN date1 AND date2. Also a bug.
confirming, assigning, targeting Jeffery: > Note also that a response in the form YYYY-MM-DD is not accepted. I > think that too is a bug Here I would say this is a missing enhancement. > Also note that that Query Designer will not accept the more obvious > BETWEEN date1 AND date2. Also a bug. Please file a separate issue for this - please one problem per issue only, to not mix things up, and to allow tracking of what happens.
also reproduced this with dBase - querying for a date range fails :(
Per your suggestions I filed Issues 18757 and 18758 today.
Fixed in CWS oj07. The query works now with >= :bDate and <= :eData. It was the same problem as with issuse #18758#. Best regards, Ocke
change subcomponent to 'none'
.
set to fixed
verify in CWS oj07
works in src680 m33 -> close
Hi, fixed in current developer build -> close. The current developer build can be found at http://download.openoffice.org/680/index.html Feel free to reopen if this issue is not fixed in the developer build. Bye Marc