顧客支払明細SQL_billdate

3002 ワード

select arap_djfb.paydate    as  ,
       bd_corp.unitname     as  ,
       bd_cubasdoc.custcode as  ,
       bd_cubasdoc.custname as  ,
       bd_accbank.bankacc   as  ,
       arap_djfb.bbye       as  ,
       arap_djfb.fkyhmc     as  ,
       arap_djfb.zy         as  
  from bd_cubasdoc, arap_djfb, bd_cumandoc, arap_djzb, bd_corp, bd_accbank
 where arap_djfb.ksbm_cl = bd_cumandoc.pk_cumandoc
   and bd_cumandoc.pk_cubasdoc = bd_cubasdoc.pk_cubasdoc
   and arap_djfb.vouchid = arap_djzb.vouchid
   and bd_corp.pk_corp = arap_djzb.dwbm
   and bd_accbank.pk_accbank = arap_djfb.skyhzh
   --and arap_djfb.payflag in ('1', '2')
   and arap_djfb.dr = '0'
   and bd_corp.unitcode='010301'
   and arap_djfb.billdate ='2011-09-22'  -- , , 
   
 order by bd_corp.unitcode, arap_djfb.paydate,  bd_cubasdoc.custname