select batchId, fileFormat, batchTime, fileName, 0 fileExists, 0 matchFound, 0 linesSearched from tbl_EAI_inboundBatches where ownerId = 1 and ownerType = 'MFR' and fileFormat like '$RPC_1FS_Trade_DataExport%' order by batchTime select * from qmd_batchSearch where fileExists = 1 order by batchTime