Skip to main content
Skip table of contents

SQL - BAs with Revenue Interest in DOs

Description

BAs with Revenue Interest in DOs

Usage

Used as an export for PDS or other downstream systems to provide all BA information associated with owners who are in any DO.

SQL

CODE
SELECT DISTINCT
	ba.number,
	ba.name,
	ba.federal_tax_code,
	r.address_1,
	r.address_2,
	r.address_3,
	r.city,
	r.state,
	r.postal_code,
	r.country,
	r.office_phone,
	r.email
FROM
	business_associates ba
	JOIN roles r ON r.business_associate_id = ba.id
	JOIN upstream_lines_of_interest loi ON loi.role_anchor_id = r.anchor_id
	JOIN upstream_division_orders udo ON udo.anchor_id = upstream_division_order_anchor_id
	JOIN upstream_ownership_cycles uc ON uc.upstream_division_order_anchor_id = udo.anchor_id
WHERE
	ba.federal_tax_code IS NOT NULL
	AND ba.federal_tax_code <> ''
	AND udo.copy_name = 'ORIGINAL'
	AND udo.from_date <= sysdatetime ()
	AND SYSDATETIME () <= udo.to_date
	AND r.from_date <= sysdatetime ()
	AND SYSDATETIME () <= r.to_date
	AND uc.jib = 0
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.