See http://meta.stackoverflow.com/questions/94852/what-could-increase-the-upvotes-on-old-answers-i-am-getting/94888#94888
Q&A for community managers, administrators, and moderators
-- Reputation for old questions/answers -- See http://meta.stackoverflow.com/questions/94852/what-could-increase-the-upvotes-on-old-answers-i-am-getting/94888#94888 with oldVotes as ( select p.PostTypeID as postType, v.VoteTypeID as voteType, v.ID as voteID, p.ID as postID, -- '<a href="http://stackoverflow.com/q/'+ convert(varchar, p.Id) + '">' + convert(varchar, p.Id) + '</a>' as postID, p.CreationDate as pDate, v.CreationDate as vDate, case p.postTypeID when 1 then -- question case v.voteTypeID when 2 then 5 -- upvote when 3 then -2 -- downvote else 0 end when 2 then -- answer case v.voteTypeID when 1 then 15 -- accepted when 2 then 10 -- upvote when 3 then -2 -- downvote else 0 end end as rep, Datediff(day, p.CreationDate, v.CreationDate) as ddiff from votes as v join posts as p on v.PostId = p.Id where p.OwnerUserId = '##userId##' and v.votetypeid in (1, 2, 3) and Datediff(day, p.CreationDate, v.CreationDate) > ##minimalDistance## ) select count(o.voteID), sum(o.rep) as rep, postID, convert(date, o.vDate) as vDate from oldVotes o group by postID, vDate order by o.vDate -- votetypes vt join votes v on vt.ID = v.VoteTypeID -- and p.CreationDate > NOW()-200 -- group by v.postid -- group by p.PostTypeID, v.VoteTypeID, vt.name, p.Id, -- p.CreationDate, -- v.CreationDate, -- Datediff(day, p.CreationDate, v.CreationDate) -- having Datediff(day, p.CreationDate, v.CreationDate) > 3