Please find below query to get customer Bill_To Address

 

SELECT DECODE (hcsua.site_use_code,
‘BILL_TO’, hl.address1
|| ‘, ‘
|| hl.address2
|| ‘, ‘
|| hl.city
|| ‘, ‘
|| hl.state
|| ‘, ‘
|| hl.country
|| ‘, ‘
|| hl.postal_code
) customer_bill_to_address
FROM hz_cust_acct_sites_all hcsa,
hz_party_sites hps,
hz_cust_site_uses_all hcsua,
hz_cust_accounts hca,
hz_parties hp,
hz_locations hl
WHERE hps.party_site_id = hcsa.party_site_id
AND hcsa.cust_acct_site_id = hcsua.cust_acct_site_id
AND hca.cust_account_id = hcsa.cust_account_id
AND hp.party_id = hca.party_id
AND hl.location_id = hps.location_id
AND hcsua.site_use_code = ‘BILL_TO’
–AND hp.party_name = :p_cust_name
AND hcsua.primary_flag = ‘Y’
AND hca.cust_account_id = :cust_id
Recent Posts

Start typing and press Enter to search