PREVIEW ONLY - CHANGES NOT COMMITED

select count(*) operatorCount from tbl_OPR_CLientOperators where ownerId = and fsltablecode = and territoryId = select count(*) distributorCount from tbl_CDR_Distributors where ownerId = and fsl_tablecode = and cdr_territoryId = select m.fspro_userid, case when m.fspro_userId is null then 'ZZ Unassigned' else m.firstName + ' ' + m.lastName end assignedRep, count( opr.operatorId ) operatorCount from tbl_OPR_CLientOperators opr left outer join tbl_FSPro_members m on m.fspro_userId = opr.mfr_bsr_id where opr.ownerId = and opr.fsltablecode = and opr.territoryId = group by m.fspro_userId, m.firstName, m.lastName order by assignedRep select m.fspro_userid, case when m.fspro_userId is null then 'ZZ Unassigned' else m.firstName + ' ' + m.lastName end assignedRep, count( cdr.cdr_recordId ) distributorCount from tbl_CDR_Distributors cdr left outer join tbl_FSPro_members m on m.fspro_userId = cdr.mfr_bsr_id where cdr.ownerId = and cdr.fsl_tablecode = and cdr.cdr_territoryId = group by m.fspro_userId, m.firstName, m.lastName order by assignedRep

#qmd_destinationTerritory.name#

#name#

select m.fspro_userid, case when m.fspro_userId is null then 'ZZ Unassigned' else m.firstName + ' ' + m.lastName end assignedRep, count( opr.operatorId ) operatorCount from tbl_OPR_CLientOperators opr left outer join tbl_FSPro_members m on m.fspro_userId = opr.mfr_bsr_id where opr.ownerId = and opr.fsltablecode = and opr.territoryId = group by m.fspro_userId, m.firstName, m.lastName order by assignedRep select m.fspro_userid, case when m.fspro_userId is null then 'ZZ Unassigned' else m.firstName + ' ' + m.lastName end assignedRep, count( cdr.cdr_recordId ) distributorCount from tbl_CDR_Distributors cdr left outer join tbl_FSPro_members m on m.fspro_userId = cdr.mfr_bsr_id where cdr.ownerId = and cdr.fsl_tablecode = and cdr.cdr_territoryId = group by m.fspro_userId, m.firstName, m.lastName order by assignedRep

#qmd_destinationTerritory.name# Before

Operator Counts
#assignedRep# #val( operatorCount )#
Distributor Counts
#assignedRep# #val( distributorCount )#
Team Members
#firstName# #lastName##teamMemberRole#

#qmd_destinationTerritory.name# After

Operator Counts
#assignedRep# #val( operatorCount )#
Distributor Counts
#assignedRep# #val( distributorCount )#
Team Members
#firstName# #lastName##teamMemberRole#

PREVIEW ONLY - CHANGES NOT COMMITED