SELECT Dateness = dateadd(year,datediff(year,0, p.Creatio...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

SELECT 
    Dateness = dateadd(year,datediff(year,0, p.CreationDate),0),
    Vcount = sum( p.ViewCount)/((sum(case when v.VoteTypeId = 2 then 1 else 0 end)+0.0)/ sum(case when v.VoteTypeId = 3 then 1 else 0 end))
    --Cyear = DATEADD(month, DATEDIFF (month, 0, p.CreationDate), 0),
from Posts p
join Votes v on p.Id = v.PostId
where p.Title != '' 
    and p.CreationDate > '20080101' 
    and charindex( ' hostile', p.Title) > 0
    or charindex( ' polite', lower(p.Title)) > 0
    or charindex( ' nicer to new', lower(p.Title) ) > 0
group by  dateadd(year,datediff(year,0, p.CreationDate),0)
order by  dateadd(year,datediff(year,0, p.CreationDate),0)

Enter Parameters

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