I am creating a reconciliation report to compare data in two databases (different departments). I need to know which records exist in one database and not the other [DONE], I also need to know if there is a discrepency in the data between records that match. Here is where I am having trouble. Rather than create a report to compare each field for accuracy, I am trying to make one report that uses OR's to look for and display problems:
{%CON_BANNER_HOLD} = "1" and
{RPT_CONTRAVENTION_VIEW.CON_AMOUNT_DUE} > 5.00 and
Not(IsNull({RPT_ENTITY_VIEW.ENT_PRIMARY_ID})) and
Not (IsNull({BannerHolds.PUID}))
This is the standard filtering block. after this I have several fields that I am comparing and I want to make it look something like this:
{%CON_BANNER_HOLD} = "1" and
{RPT_CONTRAVENTION_VIEW.CON_AMOUNT_DUE} > 5.00 and
Not(IsNull({RPT_ENTITY_VIEW.ENT_PRIMARY_ID})) and
Not (IsNull({BannerHolds.PUID})) and
AAA.ZZZ <> BBB.ZZZ or
AAA.YYY <> BBB.YYY or
AAA.XXX <> BBB.XXX
The problem is, I believe the code is happening sequencially..that is to say the OR's are not including the first block of AND's and is giving me the AND block, OR the ZZZ, OR the YYY, OR the XXX.
I realize that I could just repeat the AND block with each OR, but the report seems to run doggedly slow when I do this. I know in SQL you can group several criteria staments like this:
{%CON_BANNER_HOLD} = "1" and
{RPT_CONTRAVENTION_VIEW.CON_AMOUNT_DUE} > 5.00 and
Not(IsNull({RPT_ENTITY_VIEW.ENT_PRIMARY_ID})) and
Not (IsNull({BannerHolds.PUID})) and
(AAA.ZZZ <> BBB.ZZZ or
AAA.YYY <> BBB.YYY or
AAA.XXX <> BBB.XXX)
using the parenthesis, but it doesn't seem to matter in Crystal. Am I completely missing something or is this intentional? Is there a way around repeating the AND block for each OR statement?