SELECT 'L' as Ind, Ledger_Id, (SELECT Ledger_Name FROM $master_db.Ledger_Master WHERE Ledger_Id = trans.Ledger_Id) as 'Ledger',  SUM(Credit_Amount) as 'Credit Amount', SUM(Debit_Amount) as 'Debit Amount' FROM $trans_db.Transaction_Helper trans WHERE Voucher_Date >='$fromDateTime' AND Voucher_Date <='$toDateTime' AND Voucher_Type like '$f1' GROUP BY Ledger_ID ORDER BY Ledger