select comm fdate1=bdate ldate1=edate select master1 index on date to master11 zap do while fdate1<=ldate1 select distinct (vou_no) from crsalp where date=fdate1 and vou_type='SR' into cursor vf select vf sr1=reccount() select distinct (vou_no) from cashsalp where date=fdate1 and vou_type='SC' into cursor fg select fg sc1=reccount() select distinct (vou_no) from crprp where date=fdate1 and vou_type='PR' into cursor vg select vg pr1=reccount() select distinct (vou_no) from cashprp where date=fdate1 and vou_type='PC' into cursor wg select wg pc1=reccount() select distinct (vou_no) from vouchers where date=fdate1 and vou_type='CR' into cursor va select va cr1=reccount() select distinct (vou_no) from vouchers where date=fdate1 and vou_type='CP' into cursor vb select vb cp1=reccount() select distinct (vou_no) from vouchers where date=fdate1 and vou_type='JV' into cursor ve select ve jv1=reccount() totals = cr1+cp1+jv1+sr1+sc1+pr1+pc1 if totals>0 select master1 append blank replace date with fdate1 replace open_dr with cr1 replace open_cr with cp1 replace debit with jv1 replace credit with sr1 replace close_dr with sc1 replace close_cr with pr1 replace wt with pc1 replace balance with t endif fdate1 = fdate1+1 enddo