SELECT 'I' as Ind, ItemID,  ( SELECT Item_Name FROM $master_db.Sales_Inventory_Items where item_id = itemID ) as Item,  SUM(CR_QTY) as Quantity, SUM(Cr_Amount) as Value  FROM $trans_db.transaction_item_helper  Where from_location like '$f1' AND VoucherDate >= str_to_date('$fromDateTime','%Y-%m-%d') AND VoucherDate <= str_to_date('$toDateTime','%Y-%m-%d') group by ItemID