select
--hza.cust_account_id,
hza.account_number,hza.account_name,
--hps.PARTY_SITE_ID,
hps.party_site_number,
hzas.attribute1 DUNS,
hzas.org_id
,hzs.location, hzs.site_use_code ,hzs.bill_to_site_use_id,hzs.status,
hzs.FOB_POINT,hzs.FREIGHT_TERM,hzs.PAYMENT_TERM_ID,rt.name "Payment Term",hzs.PRICE_LIST_ID,qp.name "Price List",
(hzs.ATTRIBUTE2||''||hzs.ATTRIBUTE3) "Shipping Instructions",(hzs.ATTRIBUTE4||''||hzs.ATTRIBUTE5) "Packing Instructions", hzs.SITE_USE_ID,hzs.CUST_ACCT_SITE_ID
from
hz_cust_accounts_all hza,
hz_cust_acct_sites_all hzas,
hz_cust_site_uses_all hzs,
hz_party_sites hps,
apps.ra_terms rt,
apps.qp_list_headers_all qp
where 1=1
and hza.CUST_ACCOUNT_ID = hzas.CUST_ACCOUNT_ID
AND hzas.org_id =103
and hzas.PARTY_SITE_ID = hps.PARTY_SITE_ID
AND hzas.cust_acct_site_id = hzs.cust_acct_site_id
--AND SITE_USE_CODE ='SHIP_TO'
AND hzas.status ='A'
AND hzas.attribute1 in ('785565271')
AND hzs.payment_term_id = rt.term_id
AND hzs.price_list_id = qp.list_header_id
AND qp.active_flag = 'Y'
order by hzas.attribute1 ,hzs.site_use_code
No comments:
Post a Comment