SELECT 'V' , Voucher_No, Voucher_Prefix, 'WORK ORDER',  Voucher_Date as 'Voucher Date',  CONCAT(Voucher_Prefix, '-', Voucher_No) as 'WorkOrder No' ,VoucherStatus as 'Status' FROM Work_Order_Main som WHERE str_to_date(concat(Voucher_Date,' ',CAST(`TimeStamp` AS TIME)),'%Y-%m-%d %H:%i:%s') >= str_to_date('$fromDateTime','%Y-%m-%d %H:%i:%s') AND str_to_date(concat(Voucher_Date,' ',CAST(`TimeStamp` AS TIME)),'%Y-%m-%d %H:%i:%s') <= str_to_date('$toDateTime','%Y-%m-%d %H:%i:%s')
