SELECT 'I' as Ind, ItemID, (SELECT Item_Name FROM $master_db.Sales_Inventory_Items WHERE Item_Id = ItemID) as 'Item', SUM(Cr_Qty) as 'Cr Qty', SUM(Dr_Qty) as 'Dr Qty', SUM(Cr_Amount) as 'Credit Amount', SUM(Dr_Amount) as 'Debit Amount' FROM $trans_db.Transaction_Item_Helper WHERE VoucherDate >='$fromDateTime' AND VoucherDate <='$toDateTime' AND VoucherType like '$f2' GROUP BY ItemID ORDER BY Item