Users with over 200 reputation and 1 year on system without Yearling badge

0

Please login or register to vote for this query.

(click on this box to dismiss)

Strangely I noticed that some users have been in the system for over a year and have over 200 reputation but still do not have the Yearling badge awarded. This query returns those users.

Role-playing Games

Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games

-- Users with over 200 reputation and 1 year on system without Yearling badge
-- Strangely I noticed that some users have been in the system for over a year and have over 200 reputation but still do not have the Yearling badge awarded.  This query returns those users.

DECLARE @yearAgo DATETIME
SET @yearAgo = dateadd(day,-400,getdate())

select 
  u.Id As [User Link], u.Reputation, u.CreationDate
from 
  Users u 
where  
  u.CreationDate < @yearAgo
  and u.Reputation > 199
  and u.Id not in
  (select UserId 
   from Badges b
where b.Name = 'Yearling')
order by u.CreationDate

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results