Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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' " +
- " FROM [dbo].[AuditLog] "+
- " WHERE ActionTaken = 'Clicked' "+
- " and Type = 'Attachment Link'" +
- " 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") + "') "+
- " GROUP BY CONVERT(date, [DateTime]), ActionBy "+
- " HAVING COUNT(DISTINCT Identifier) > " + limit +
- " ORDER BY COUNT(DISTINCT Identifier) DESC";
- " and Type = 'Attachment Link' OR 'Attachment Link - Search'" +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement