Subquery in Crystal Reports
Posted on 2010-11-22
I am developing a report which will have registrants statistics of a conference selected by user.
The parent Conferences have ParentID = NULL and should be displayed as paramenter to be selected by user.
Once the user selects a parent conference, I need to display registrants from ALL child conferences and the parent conference itself grouped by the 'designations' of the registrants.
I have come up with the following SQL:
when '' then 'Unknown'
when NULL then 'Unknown'
END as Designation
,Count(*) as Registrants
Inner JOIN vwPerson on vwMeetingReg.ID = vwPerson.ID
INNER JOIN vwProducts on vwMeetingReg.MeetingID = vwProducts.ID
WHERE vwProducts.Id in (select ID from vwproducts where Id = 8543 Or ParentId = 8543)
Group by Designation
Here, '8543' is ID of the parent conference selected by the user
I am trying to figure out how to fit the WHERE clause in Crystal Report.
Thanks in advance.