a guest Jun 25th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- -- Program Name List
- Scanner Module
- Email Receiver
- Outgoing Faxing
- IR Web Service
- IR Web SDK
- Outlook Interface
- SharePoint Integration
- Web Client
- declare @ProgramName varchar(100), @MinDate datetime, @MaxDate datetime
- set @ProgramName = 'Scanner Module'
- set @MinDate = '2019-02-01 00:00:00.000'
- set @MaxDate = '2019-03-01 00:00:00.000'
- select @ProgramName,DateRange=Cast(@MinDate as varchar(20)) + ' - ' + Cast(@MaxDate as varchar(20))
- , ot.programmaticname
- , DocCount=count(distinct df.docfolderid)
- , PageCount=count(distinct p.PageID)
- from Batches b with (nolock)
- join IRPrograms irp on irp.programid = b.programid
- and irp.programname = @ProgramName
- and b.datecaptured between @MinDate and @MaxDate
- join ImageSet iset with (nolock) on iset.batchid = b.batchid
- join Pages p with (nolock) on p.imagesetid = iset.imagesetid
- --and p.pagenumber = 1
- join DocFolder df with (nolock) on df.docfolderid = p.documentid
- join ObjectLink ol with (nolock) on ol.objectid = df.fileid
- join ObjectType ot on ot.typeid = ol.typeid
- group by ot.programmaticname
RAW Paste Data