Top 100 Most Frequent Voters

-- Top 100 Most Frequent Voters
-- The top 100 users based on the number of votes cast per day
DECLARE @lastDataUpdate DATETIME
SELECT @lastDataUpdate = MAX(CreationDate) FROM Posts
SELECT TOP 100
U.Id AS [User Link],
U.UpVotes,
U.DownVotes,
(U.UpVotes + U.DownVotes) AS TotalVotes,
ROUND(CAST(U.UpVotes AS FLOAT) / (DateDiff(day,U.CreationDate,@lastDataUpdate)+1),3) AS UpVotesPerDay,
ROUND(CAST(U.DownVotes AS FLOAT) / (DateDiff(day,U.CreationDate,@lastDataUpdate)+1),3) AS DownVotesPerDay,
ROUND(CAST((U.UpVotes + U.DownVotes) AS FLOAT) / (DateDiff(day,U.CreationDate,@lastDataUpdate)+1),3) AS VotePerDay
FROM
Users U
ORDER BY
VotePerDay DESC