I'm trying to determine age of post and make a graph based upon it:
I made this query:
select sum(ViewCount), DATE() - CreationDate AS age
FROM Posts
WHERE
PostTypeId = 1
GROUP BY age
ORDER BY age
I'm using DATE()
but that doesn't work:
How should I calculate post age?