Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Misbehaving "or" statement

Status
Not open for further replies.

Deano1976

Technical User
Dec 16, 2004
41
GB
Crystal version 8.5

Using the following select statement we want to retrieve data from one table which is support incident which is joined to customer and in house site tables by left outer joins. We know that we should have 976 records in total. If we run the report with criteria as below we retrieve 966.

{Customer.Site Code}="995" or
{In_House_Site.Site Code} = "995"

If we switch it to:

{In_House_Site.Site Code} = "995" or
{Customer.Site Code}="995"
we retrieve 132 records of which 122 are in the first criteria version. However, the bizarre thing is that we have an identical report that suffers none of these problems and retrieves the full 976 records we require !!
 
The selections on the right hand table are "undoing" the left joins. To see all the desired records, remove the selection criteria and then go to the section expert->details->suppress->x+2 and enter:

(
isnull({Customer.Site Code}) or
{Customer.Site Code}<> "995"
) and
(
isnull({In_House_Site.Site Code}) or
{In_House_Site.Site Code} <> "995"
)

-LB
 
Thanks I'll give that a try, however how do you explain the report that is identical but does appear to work?
 
Clearly the report is not identical. Is there a different datasource?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top