Icon View Incident Report

Serious Serious
Reported By: Herbert Sitz
Reported On: 7/22/2003
For: Version 3.24 Build 1
# 1398 Using a NOT Operator With an OR Expression From Two Different Data Sources Causes Incorrect Results

I'm running v3.21 and I'm getting what seem to be some strange results when using NOT's in my where clause.

For example, I run this query:

SELECT c.FirstName, c.LastName, d.DonationDate, d.Amount
FROM Contacts c
LEFT OUTER JOIN Donations d ON (c.ContactID=d.ContactID)
WHERE ( NOT
(c.FirstName <= 'M') and
NOT (d.DonationDate between '1998-07-22' and '2003-07-22')
)

and I get a list of 280 records where the firstname is not <= 'M' and where the donation date is outside the range of 7/22/98 to 7/22/03.

But if I run what should be the equivalent query:

SELECT c.FirstName, c.LastName, d.DonationDate, d.Amount
FROM Contacts c
LEFT OUTER JOIN Donations d ON (c.ContactID=d.ContactID)
WHERE NOT (
(c.FirstName <= 'M') OR
(d.DonationDate between '1998-07-22' and '2003-07-22')
)

from this query I get 575 records which include, among other things, records where the first names are definitely <= 'M' and where the dates are between 1998 and 2003. I'm not sure exactly what records are included and what are excluded, but the full record set (without a WHERE restriction) has 855 records, so something is getting excluded.


Resolution Resolution
Fixed Problem on 7/23/2003 in version 3.25 build 1
Image