I have the query below supplied by another clever EE member. It returns amounts for 10 second intervals. My question is, if I want to change the interval to eg. 45 mins is it as simple as changing every "ss" to "mi" and every 10 to 45?
d( ss, interval*10, CONVERT(int,getdate()) ), 121) as interval, amount
)/10 as interval, SUM(amount) as amount
where [timestamp] >= convert(int,getdate()) -- this will limit the data to today's date, from midnight
group by DATEDIFF(ss,convert(int,ge
The original question is here if you want a description of the table involved: http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_27245666.html
Thanks in advance!