Hi,
i have a table which contains the following columns:
Id = bigint id 1 +1
Machineid = bigint
logdate = datetime
vtp = bigint,
There are more records for 1 machine p/day
i want to group them together by complete day and get the sum of vtp for every different machine for each day.
Someone knows how to do this?
Thanx in front!
CHeers Wimselect machineid, convert(char(10),logdate,120), sum(vtp)
from <your_table>
where <if any conditions apply>
group by machineid, convert(char(10),logdate,120)
order by machineid, convert(char(10),logdate,120)
/*
look up cast / convert in BOL for other date / time formats
*/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment