SHARE
TWEET

Untitled

a guest Jun 25th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. -- Program Name List
  3. Scanner Module
  4. Desktop
  5. Email Receiver
  6. Outgoing Faxing
  7. Imports
  8. IR Web Service
  9. IR Web SDK
  10. Outlook Interface
  11. SharePoint Integration
  12. Web Client
  13. */
  14.  
  15. declare @ProgramName varchar(100), @MinDate datetime, @MaxDate datetime
  16. set @ProgramName = 'Scanner Module'
  17. set @MinDate = '2019-02-01 00:00:00.000'
  18. set @MaxDate = '2019-03-01 00:00:00.000'
  19.  
  20.  
  21.  
  22.     select @ProgramName,DateRange=Cast(@MinDate as varchar(20)) + ' - ' + Cast(@MaxDate as varchar(20))
  23.     , ot.programmaticname
  24.     , DocCount=count(distinct df.docfolderid)
  25.     , PageCount=count(distinct p.PageID)
  26.     from Batches b with (nolock)
  27.         join IRPrograms irp on irp.programid = b.programid
  28.             and irp.programname = @ProgramName
  29.             and b.datecaptured between @MinDate and @MaxDate
  30.         join ImageSet iset with (nolock) on iset.batchid = b.batchid
  31.         join Pages p with (nolock) on p.imagesetid = iset.imagesetid
  32.             --and p.pagenumber = 1
  33.         join DocFolder df with (nolock) on df.docfolderid = p.documentid
  34.         join ObjectLink ol with (nolock) on ol.objectid = df.fileid
  35.         join ObjectType ot on ot.typeid = ol.typeid
  36.     group by ot.programmaticname
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top