I’m coming from MySQL and trying to code T-SQL on SQL Server 2005, and I’m finding it completely different.
Here’s what I want to do (using MySQL)
select sum(datapoint) as sum, date(mytimestamp) as date
from datalog
where datapoint = '27'
group by date
i.e. get a list of data summed and grouped by date.
converting to varchar is not a good solution, simply remove the timepart from your timestamp and group by it like this: