DefconDotNet

Untitled

Mar 20th, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.29 KB | None | 0 0
  1. Select LogIP, Count(*) as aantal
  2. From
  3. (
  4.     SELECT [LogIP], Count(log_id) as aantalLogins
  5.     FROM [e-Boekhouden.nl].[dbo].[tblLogins]
  6.     where [LogDatum] >= DateAdd(day, -180, getdate())    
  7.     group by [LogIP], DATEDIFF(day,LogDatum,getdate()) / 30
  8. ) sa
  9. group by sa.LogIP
  10. having Count(*) > 1
Advertisement
Add Comment
Please, Sign In to add comment