Search This Blog

Sunday, November 21, 2010

Monthwise Customer Statistics

select party.party_name,acnt.ACCOUNT_NUMBER
from
hz_parties                         PARTY,
      hz_cust_accounts                   ACNT,
      hz_cust_acct_sites_all             SITE,
      hz_cust_site_uses_all              USES,
      hz_party_sites                     PS
where PARTY.party_id = ACNT.party_id
 AND ACNT.cust_account_id = SITE.cust_account_id
 AND SITE.cust_acct_site_id = USES.cust_acct_site_id
 AND ps.party_site_id = site.party_site_id
 AND uses.site_use_code = 'BILL_TO'
 AND PARTY.CREATED_BY_MODULE not like '%HR%'
 AND     PARTY.creation_date between '01-Jan-2009' and '30-Sep-2009'

No comments:

Post a Comment