#url.datasource#
#ListLen(form.batchids)# batches Reset (#form.batchids#)
select 'I' as type, b.batchId as pkid, b.batchId, b.status, b.statusTime, b.message, b.batchTime,
datediff( minute, b.batchTime, b.processedTime ) delay,
datediff( minute, b.startTime, b.processedTime) runTime, b.fileName, b.lineCount, b.processedTime,
b.allowReprocess, b.dependentBatchId, b.queueStatus, b.config,
b.fileFormat, b.ownerId, b.ownerType, b.triggerTime, b.startTime,
b.watchdognotificationsent,b.batchclass, b.parentBatchId
from tbl_EAI_InboundBatches b with (nolock)
where 1=1
and b.fileFormat = '$GS1_CatalogItemNotification'
and ( ( b.status NOT IN ('OK','PENDING','RUNNING') ) OR (message = 'Parse Issues!') )
and b.batchTime > dateAdd(wk,-2, getDate() )
order by b.batchTime asc, b.batchId asc
#url.datasource#