I am trying to create a report in crystal reports 11 based on this sql query
SELECT *
FROM (table) OM, (table) OL, (table) C
WHERE OM.ORDER = OL.ORDER
AND OM.COMPANY = C.COMPANY
AND (EXISTS (SELECT *
FROM (table) OSD, (table) OSDD
WHERE OSD.ORDER = OL.ORDER
AND OSD.LINE = OL.LINE
AND OSD.REVISION = OL.REVISION
AND OSD.DIM = OSDD.DIM
AND OSDD.SHAPE = OL.SHAPE))
I thought the best way to start was by creating the main report using the first two tables and creating a subreport using the "EXISTS" section of the query and linking back to the main report.
My details section contains both data from the main report and the subreport. I get the correct results back for where the subreport returns a value, but I want to be able to suppress the detail section of the main report if the subreport is null, but I can't find a way to reference the subreport in any of the selection formulas.
I am open to suggestions if there is a better way to mimic this query as well.