SELECT 'E' as Ind, sal.Salesman_ID, (SELECT Name FROM Employee_Details WHERE _id= sal.Salesman_ID) Name, COUNT(Voucher_No) Count,SUM(Total) Amount  FROM $trans_db.Sales_Invoice_Main sal  WHERE  ( str_to_Date(concat(sal.Voucher_Date, substr(`TimeStamp`, 11,19)) ,'%Y-%m-%d %H:%i:%s')>=str_to_date('$fromDateTime','%Y-%m-%d %H:%i:%s') and str_to_Date(concat(sal.Voucher_Date, substr(`TimeStamp`, 11,19)) ,'%Y-%m-%d %H:%i:%s')<= str_to_date('$toDateTime','%Y-%m-%d %H:%i:%s')) group by Salesman_ID