<
ConfigurationEntryItem>
<ConfigurationEntry>Attachment/ArchiveFileSearch</ConfigurationEntry>
<Source>Attachment.config</Source>
<ConfigurationType>qbo.Application.Configuration.DbStatementCollection</ConfigurationType>
<ConfigurationKey>ArchiveFileSearch</ConfigurationKey>
<ConfigurationXml>
<Statement Name="ArchiveFileSearch" ReturnType="DataReader" Permission="{Table}ArchiveFileSearch" Timeout="1200" AllowInheritance="true" Query="
SELECT TOP {Param.Batch} AttachmentID, Attachment.ArchiveScheduled UpdatedDate FROM Attachment
INNER JOIN AttachmentTemplate
ON Attachment.AttachmentTemplateID = AttachmentTemplate.AttachmentTemplateID
WHERE ArchiveScheduled < GETDATE()
AND Attachment.FileObjectAssembly <> AttachmentTemplate.ArchiveObjectAssembly
AND ArchivalDate IS NULL
AND Attachment.ArchiveScheduled >= '{Param.FromDate}'
AND ISNULL(Attachment.Status, '') <> 'Error'
ORDER BY Attachment.ArchiveScheduled
">
<Parameters>
<Parameter Name="FromDate" DbType="DateTime" />
<Parameter Name="Batch" DbType="Int32" Value="500" />
</Parameters>
</Statement>
</ConfigurationXml>
</ConfigurationEntryItem>