Skip to content

Instantly share code, notes, and snippets.

@gtaing1
Created July 27, 2018 19:36
Show Gist options
  • Save gtaing1/e0228be6d9675fa8c749aa804a5f71c8 to your computer and use it in GitHub Desktop.
Save gtaing1/e0228be6d9675fa8c749aa804a5f71c8 to your computer and use it in GitHub Desktop.
select
UserName as Name,
Email as email,
Role as role,
PageVisited as ViewedPage,
/*Count(PageVisited) as NumberofHits,*/
COUNT(CAST(Date as date)) as NumberOfVisits,
CAST(Date as date) as LastVisitedDate
from [dbo].[UserActivityLog]
where EMAIL NOT LIKE '%starcom%'
group by UserName,Role,Email,PageVisited,CAST(Date as date)
order by LastVisitedDate DESC
select * from [dbo].[UserActivityLog]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment