Query to find Sales Person

SELECT hcsu.primary_salesrep_id
FROM hz_cust_accounts hca,
hz_cust_acct_sites_all hcas,
hz_cust_site_uses_all hcsu
WHERE hca.cust_account_id = 940301
AND hca.cust_account_id = hcas.cust_account_id
AND hcas.cust_acct_site_id = hcsu.cust_acct_site_id
AND hcsu.site_use_code = ‘BILL_TO’
AND hcsu.LOCATION = ‘EVA’
AND hcas.status = ‘A’
AND hcsu.status = ‘A’;

Recent Posts

Start typing and press Enter to search