Im creating a certificate report and having problems when I have multiple sponsors.
The first query is working fine...
SELECT Filteredmag_eventregistration.mag_contactidname AS Attendee, Filteredmag_eventregistration.mag_attendedname, Filteredmag_eventregistration.mag_attended,
Filteredmag_eventregistration.mag_eventidname AS EventName, Filteredmag_eventregistration.statuscodename AS Status, FilteredContact.parentcustomeridname,
FilteredContact.csg_dietaryrequirements, FilteredContact.csg_dietarycomments, Filteredmag_event.mag_eventvenueidname AS Venue,
Filteredmag_event.new_caterername AS Caterer, Filteredmag_event.new_cpdpoints AS CPDPoints, Filteredmag_event.new_accrmno AS ActivityNo,
Filteredmag_event.new_programname, Filteredmag_event.mag_date AS DateAndTime, Filteredmag_event.mag_eventid,
Filteredmag_event.mag_duration AS Duration, Filteredmag_event.statuscodename, Filteredmag_event.mag_capacity, Filteredmag_event.new_invited,
FilteredContact.telephone1 AS Telephone, Filteredmag_eventregistration.new_dietaryrequirements
FROM Filteredmag_eventregistration INNER JOIN
Filteredmag_event ON Filteredmag_eventregistration.mag_eventid = Filteredmag_event.mag_eventid INNER JOIN
FilteredContact ON Filteredmag_eventregistration.mag_contactid = FilteredContact.contactid
WHERE (Filteredmag_eventregistration.mag_eventidname IN (@pEvent)) AND (Filteredmag_eventregistration.statuscodename = N'Registered')
I use this query to produce certificates for anyone who attended the event.
Query with sponsor table added
SELECT Filteredmag_eventregistration.mag_contactidname AS Attendee, Filteredmag_eventregistration.mag_attendedname, Filteredmag_eventregistration.mag_attended,
Filteredmag_eventregistration.mag_eventidname AS EventName, Filteredmag_eventregistration.statuscodename AS Status, FilteredContact.parentcustomeridname,
FilteredContact.csg_dietaryrequirements, FilteredContact.csg_dietarycomments, Filteredmag_event.mag_eventvenueidname AS Venue,
Filteredmag_event.new_caterername AS Caterer, Filteredmag_event.new_cpdpoints AS CPDPoints, Filteredmag_event.new_accrmno AS ActivityNo,
Filteredmag_event.new_programname, Filteredmag_event.mag_date AS DateAndTime, Filteredmag_event.mag_eventid,
Filteredmag_event.mag_duration AS Duration, Filteredmag_event.statuscodename, Filteredmag_event.mag_capacity, Filteredmag_event.new_invited,
FilteredContact.telephone1 AS Telephone, Filteredmag_eventregistration.new_dietaryrequirements, Filteredmag_eventsponsor.mag_sponsoridname,
Filteredmag_eventsponsor.entityimage
FROM Filteredmag_eventregistration INNER JOIN
Filteredmag_event ON Filteredmag_eventregistration.mag_eventid = Filteredmag_event.mag_eventid INNER JOIN
FilteredContact ON Filteredmag_eventregistration.mag_contactid = FilteredContact.contactid INNER JOIN
Filteredmag_eventsponsor ON Filteredmag_event.mag_eventid = Filteredmag_eventsponsor.mag_eventid
WHERE (Filteredmag_eventregistration.mag_eventidname IN (@pEvent)) AND (Filteredmag_eventregistration.statuscodename = N'Registered')
My events can have 1 or more sponsors. I would like to display these sponsors on the certificates but when I add the Sponsor table to the above query I have problems. I get 1 certificate per sponsor for each attendee rather than the more than 1 sponsors appearing on a single attendee certificate. If I only have one sponsor, its not a problem.
My list which houses all the event data takes up the entire a4 page with graphical borders and I am using a header but no footer.
Appreciate your assistance.
Thank you.