sql - SSRS Visual Studio 2008 - How to compare name to pipe delimited list of names? -
i new sql. trying count of activities done specified people in persons table.
pseudo sql query:
select count activities table left outer join persons table p p.lastname + ', ' + p.firstname 'lastname1, firstname1 | lastname2, firstname2 |..."
what way compare names in persons table pipe delimited list of names passed parameter in ssrs report?
probably looking this:
total of activities persons of interest
select count(*) activities_count activites left join persons p on a.person_id = p.id 'lee, mark | doe, jhon' '%' + p.lastname + ', ' + p.firstname + '%'
number of activities per person
select p.id, count(*) activities_count activites left join persons p on a.person_id = p.id 'lee, mark | doe, jhon' '%' + p.lastname + ', ' + p.firstname + '%' group p.id
here sqlfiddle
Comments
Post a Comment