SSRS 2017 Open Outlook email with multiple email addresses by clicking on a report field

You could concatenate the values in the source of the report.

Example SQL:

WITH
la_service_provider_service
AS
(
   SELECT tbl.* FROM (VALUES
    ( 1, '[email protected]')
   , ( 1, '[email protected]')
   , ( 1, '[email protected]')
   , ( 2, '[email protected]')
   , ( 2, '[email protected]')
   , ( 2, '[email protected]')
   , ( 2, '[email protected]')
   ) tbl ([LA_SERVICE_PROVIDER_ID], [PROVIDER_EMAIL]) 
)
SELECT 
    [lasps].[LA_SERVICE_PROVIDER_ID]
   , [lasps].[PROVIDER_EMAIL]
   , [ALL_PROVIDER_EMAILS] = 
     STUFF( (SELECT '; '+ [PROVIDER_EMAIL] 
           FROM [la_service_provider_service] AS [lasps2]
           WHERE [lasps2].[LA_SERVICE_PROVIDER_ID] = [lasps].[LA_SERVICE_PROVIDER_ID]
           FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(2000)')
        ,1,2,'')
FROM 
   [la_service_provider_service] AS [lasps];

Results:

enter image description here

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top