Q&A for administrators and users of the CiviCRM Constituent Relationship Management software
with x(Rep, CreationDate, LastPostedDate, Id) as( select a.Reputation, a.CreationDate, max(b.CreationDate), a.Id from Users a, Posts b where b.OwnerUserId = a.Id group by a.Reputation,a.CreationDate,a.Id ) select top 200 Rep, round(cast(Rep as float)/DATEDIFF(dd,CreationDate,LastPostedDate),1) RepPerDay, Id as [User Link] from x where DATEDIFF(dd,CreationDate,LastPostedDate) > 30 and Id = 646591 order by RepPerDay desc;