Issue 18594 - ADO/MDB Prompted Query Incorrect for a Date Range
Summary: ADO/MDB Prompted Query Incorrect for a Date Range
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC3
Hardware: PC Windows XP
: P2 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-24 22:40 UTC by jeffos2
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jeffos2 2003-08-24 22:40:24 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.
Comment 1 Frank Schönheit 2003-08-25 08:18:38 UTC
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.
Comment 2 Frank Schönheit 2003-08-25 09:14:45 UTC
also reproduced this with dBase - querying for a date range fails :(
Comment 3 jeffos2 2003-08-28 02:49:02 UTC
Per your suggestions I filed Issues 18757 and 18758 today.
Comment 4 ocke.janssen 2003-08-29 08:27:53 UTC
Fixed in CWS oj07.

The query works now with >= :bDate and <= :eData. It was the same
problem as with issuse #18758#. 

Best regards,

Ocke
Comment 5 hans_werner67 2004-02-02 12:21:09 UTC
change subcomponent to 'none'
Comment 6 ocke.janssen 2004-02-10 11:01:17 UTC
.
Comment 7 marc.neumann 2004-03-01 10:04:30 UTC
set to fixed
Comment 8 marc.neumann 2004-03-01 10:04:50 UTC
verify in CWS oj07
Comment 9 marc.neumann 2004-03-26 10:46:48 UTC
works in src680 m33 -> close
Comment 10 marc.neumann 2004-04-27 09:59:14 UTC
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