text TO m.cmd NOSHOW SELECT (a.acc_code+b.acc_code)as acc_code,max(acc_name) as acc_name,SUM(qty)as qty,SUM(cr_amount)as cr_amount from (select distinct(acc_code) as acc_code ,max(acc_name) as acc_name, qty, cr_amount from crsalp a where date between ?thisform.text1.value and ?thisform.text2.value and substring(acc_code,1,2)='32' and type='P' GROUP BY acc_code union all select distinct(acc_code) as acc_code ,max(acc_name) as acc_name, qty, cr_amount from cashsalp b where date between ?thisform.text1.value and ?thisform.text2.value and substring(acc_code,1,2)='31' and type='P' GROUP BY acc_code) ENDTEXTBut it has: