Hi,
I've developed a report in Crystal Reports XI which will list the records in Command 1 which are not in Command 2. The problem that I'm facing is the report takes forever to load. However, if I do the same query in Microsoft Access it loads within 10 seconds.
Command 1
SELECT CPINFO.REFVAL, CPINFO.ADDRESS, CPINFO.EHAREATM, CPINFO.TRADEAS, XIREC.REFVAL as REFVAL2, XIVISIT.XIVTYPE, XIVISIT.DATEVISIT, XIVISIT.VOFF, XIACTION.XIACT FROM ((CPINFO INNER JOIN XIREC ON CPINFO.KEYVAL = XIREC.MDKEYVAL) INNER JOIN XIVISIT ON XIREC.KEYVAL = XIVISIT.PKEYVAL) INNER JOIN XIACTION ON XIVISIT.KEYVAL = XIACTION.PKEYVAL WHERE (((XIVISIT.XIVTYPE)='FDHYG' Or (XIVISIT.XIVTYPE)='HELA' Or (XIVISIT.XIVTYPE)='FDSTDS' Or (XIVISIT.XIVTYPE)='FDHYRV' Or (XIVISIT.XIVTYPE)='FDSTRV' Or (XIVISIT.XIVTYPE)='HASREV') AND ((XIVISIT.VOFF)='JWATT' Or (XIVISIT.VOFF)='LMCCAN' Or (XIVISIT.VOFF)='SBALLA' Or (XIVISIT.VOFF)='PCONNO' Or (XIVISIT.XIVTYPE)='SCRAWF' Or (XIVISIT.VOFF)='RGIBSO' Or (XIVISIT.VOFF)='AHULL' Or (XIVISIT.VOFF)='RH' Or (XIVISIT.VOFF)='SJOSEL' Or (XIVISIT.VOFF)='JLECYN' Or (XIVISIT.VOFF)='AL' Or (XIVISIT.VOFF)='RMANSO' Or (XIVISIT.VOFF)='BMCGLO' Or (XIVISIT.VOFF)='BMCHA' Or (XIVISIT.VOFF)='NREID' Or (XIVISIT.VOFF)='MROBER' Or (XIVISIT.VOFF)='LSTARK' Or (XIVISIT.VOFF)='DWARD' Or (XIVISIT.VOFF)='NJWILL'))
Command 2
SELECT CPINFO.REFVAL, CPINFO.TRADEAS, XIREC.REFVAL as REFVAL2, XIVISIT.XIVTYPE, XIVISIT.DATEVISIT, XIVISIT.VOFF, XIACTION.XIACT, CNOFFICER.NAME FROM (((CPINFO INNER JOIN XIREC ON CPINFO.KEYVAL = XIREC.MDKEYVAL) INNER JOIN XIVISIT ON XIREC.KEYVAL = XIVISIT.PKEYVAL) INNER JOIN XIACTION ON XIVISIT.KEYVAL = XIACTION.PKEYVAL) INNER JOIN CNOFFICER ON XIVISIT.VOFF = CNOFFICER.OFFCODE WHERE (((XIVISIT.XIVTYPE)='FDHYG' Or (XIVISIT.XIVTYPE)='HELA' Or (XIVISIT.XIVTYPE)='FDSTDS' Or (XIVISIT.XIVTYPE)='FDHYRV' Or (XIVISIT.XIVTYPE)='FDSTRV' Or (XIVISIT.XIVTYPE)='HASREV') AND ((XIVISIT.VOFF)='JWATT' Or (XIVISIT.VOFF)='LMCCAN' Or (XIVISIT.VOFF)='SBALLA' Or (XIVISIT.VOFF)='PCONNO' Or (XIVISIT.VOFF)='SCRAWF' Or (XIVISIT.VOFF)='RGIBSO' Or (XIVISIT.VOFF)='AHULL' Or (XIVISIT.VOFF)='RH' Or (XIVISIT.VOFF)='SJOSEL' Or (XIVISIT.VOFF)='JLECYN' Or (XIVISIT.VOFF)='AL' Or (XIVISIT.VOFF)='RMANSO' Or (XIVISIT.VOFF)='BMCGLO' Or (XIVISIT.VOFF)='BMCHA' Or (XIVISIT.VOFF)='NREID' Or (XIVISIT.VOFF)='MROBER' Or (XIVISIT.VOFF)='LSTARK' Or (XIVISIT.VOFF)='DWARD' Or (XIVISIT.VOFF)='NJWILL') AND ((XIACTION.XIACT)='LET1' Or (XIACTION.XIACT)='LETT1' Or (XIACTION.XIACT)='LET2' Or (XIACTION.XIACT)='LETT2' Or (XIACTION.XIACT)='LET3' Or (XIACTION.XIACT)='LETT3' Or (XIACTION.XIACT)='LET3A' Or (XIACTION.XIACT)='LETT3A' Or (XIACTION.XIACT)='LETTER' Or (XIACTION.XIACT)='LET4'))
Linking
Command1.REFVAL2 --> Command2.REFVAL2
Select Expert
Isnull({Command2.REFVAL2})
Any help would be appreciated. Thanks
|