Reputation for old questions/answers


Please login or register to vote for this query.

(click on this box to dismiss)



Q&A for community managers, administrators, and moderators

-- Reputation for old questions/answers
-- See

with oldVotes as (
select p.PostTypeID as postType,
 v.VoteTypeID as voteType,
 v.ID as voteID,
 p.ID as postID,
-- '<a href="'+ convert(varchar, p.Id) + '">' + convert(varchar, p.Id) + '</a>' as postID,
 p.CreationDate as pDate,
 v.CreationDate as vDate,
 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), postID, 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,, p.Id,
--         p.CreationDate,
--         v.CreationDate,
--         Datediff(day, p.CreationDate, v.CreationDate)
-- having Datediff(day, p.CreationDate, v.CreationDate) > 3

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results