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

1

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.

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

-- 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')

Enter Parameters

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