text TO cmd TEXTMERGE noshow select vou_no,MAX(date)as date,MAX(acc_code) as acc_code, SUM(case type1 when 'P' then cr_amount else 0 END) as P_amount, SUM(case type1 when 'A' then cr_amount else 0 END) as A_amount, SUM(case type1 when 'D' then dr_amount else 0 END) as D_amount from crsalp where date=?thisform.text4.value group by vou_no ENDTEXTMartinaJ
>text TO cmd TEXTMERGE noshow > >select distinct(vou_no)as vou_no,MAX(date)as date,MAX(acc_code)as acc_code, >(case type1 when 'P' then SUM(cr_amount) end )as A_amount, >(case type1 when 'A' then SUM(cr_amount) end )as A_amount, >(case type1 when 'D' then SUM(dr_amount) end )as D_amount > from crsalp where date=?thisform.text4.value > group by vou_no > > ENDTEXT >>