Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. cmd.CommandText = "SELECT CONVERT(date, [DateTime]) 'Date of Download', ActionBy AS 'User Full Name', COUNT(DISTINCT CAST(Identifier AS NVARCHAR(10)) + Remarks + Link) 'Number of Document Downloads' " +
  2. " FROM [dbo].[AuditLog] "+
  3. " WHERE ActionTaken = 'Clicked' "+
  4. " and Type = 'Attachment Link'" +
  5. " and CONVERT(date, [DateTime]) BETWEEN CONVERT(date,'" + scanStartDate.ToString("yyyy-MM-dd HH:mm:ss.fff") + "') and CONVERT(date,'" + scanEndDate.ToString("yyyy-MM-dd HH:mm:ss.fff") + "') "+
  6. " GROUP BY CONVERT(date, [DateTime]), ActionBy "+
  7. " HAVING COUNT(DISTINCT Identifier) > " + limit +
  8. " ORDER BY COUNT(DISTINCT Identifier) DESC";
  9.  
  10. " and Type = 'Attachment Link' OR 'Attachment Link - Search'" +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement