SELECT DISTINCT avr.role_cd, avr.role_nm, td.person_id, tj.job_nm,
tc.first_nm + ' ' + tc.last_nm AS 'Full Name', td.job_id, tj.job_mne_cd
FROM ais_db.dbo.v_role avr
JOIN bill_db.dbo.t_person_legal_entity_role tpler
ON avr.role_cd = tpler.role_cd
JOIN bill_db.dbo.t_contact tc ON tpler.person_id = tc.contact_id
JOIN crs_db.dbo.t_distr td ON tpler.person_id = td.person_id
JOIN crs_db.dbo.t_job tj ON tj.job_id = td.job_id
WHERE tc.active_flg = 'Y' AND tj.job_mne_cd NOT LIKE 'Z%' AND
(avr.role_cd LIKE '%Main Contact%'
OR LIKE '%Named Fiduciary%'
OR LIKE '%Day%' OR NOT LIKE '%Client Reporting%'
OR LIKE '%Proxy Contact%'
OR LIKE '%Revenue%'
OR LIKE '%Paper%')
|