SELECT 'V' as Ind, Voucher_No, Voucher_Prefix, 'SALESVOUCHER' as Voucher_Type, Voucher_Date as 'Date', Voucher_No as 'Voucher', Total as 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') and Salesman_ID = '$f1'