select distinct spl.ownerId, spl.ownerType, spl.opportunityId, spl.partnerId, spl.partnerType, spl.salesPersonUserId from tbl_SPL_Opportunities spl inner join tbl_FSPro_members m on m.fspro_userId = spl.salesPersonUserId and m.ownerId in ( select brokerid from tbl_SMA_BrokerOfficeLink where mfr_id = spl.ownerId ) and m.fsl_tablecode = 'BRO' inner join tbl_WRK_Tasks wrk on wrk.subjectId = spl.opportunityId and wrk.subjectType = 'SPL' and wrk.ownerId = spl.ownerId and wrk.ownerType = spl.ownerType and wrk.assignedTo = spl.salesPersonUserId where spl.ownerId = and spl.ownerType = and spl.salesPersonAcknowledged = 'Y' and wrk.disposition in ( 'A', '?' ) and wrk.dueDate < getDate() select ownerId, ownerType, fromUserId, fromEmail, fromFirstName, fromLastName, salesPersonEmail, salesPersonFirstName, salesPersonLastName, count(*) opportunityCount from qmd_opportunitiesToUpdate group by ownerId, ownerType, fromUserId, fromEmail, fromFirstName, fromLastName, salesPersonEmail, salesPersonFirstName, salesPersonLastName order by ownerId, ownerType, fromUserId, salesPersonLastName, salesPersonFirstName
Sales Person Email Requests
#htmleditformat( salesPersonlastName )#, #htmleditformat( salesPersonFirstName )# #htmleditformat( salesPersonEmail )# #lsnumberformat( opportunityCount )#

Opportunity Update Requests have been sent the following Sales People

#_updateRequestSummaryHTML#
#_emailBodyHTML#

Summary Emails Sent: #_summaryEmailsSent#