I am actually creating a report on Crystal Reports v12 (2008), but I cannot find a method using Crystal to extract the following. I thought that if someone could answer in SQL, I could put it together.
2 Tables: hbmast, ddmast
SELECT hbmast.custno, hbmast.id, ddmast.name, ddmast.status
WHERE hbmast.custno = ddmast.custno
GROUP BY hbmast.id
pseudo code::show all hbmast values that have ddmast.status = '2'
Output Example:
J0001, 111222, PAUL JONES, 1
111222, PAUL JONES, 2
111222, PAUL JONES, 1
K0001, 555333, PETER KING, 3
555333, PETER KING, 1
I would like to show Paul in the report with all the child records, but Peter should not be returned to the report, since he does not have child records with "2" for the ddmast.status field.
thanks for the help
source
share