SELECT (int2str(month(Obj_header.datum))+"."+int2str(year(Obj_header.datum))) AS MESIC,SUM(Obj_header.sum_obj),COUNT(Obj_header.id_dobj),SUM(Obj_header.k_uhrade) AS SDPH,Obj_header.datum
FROM Obj_header
WHERE (Obj_header.potvrzena=true AND Obj_header.storno<>true AND Obj_header.zpracovana<>NONEDATE)
GROUP BY (month(Obj_header.datum)+year(Obj_header.datum)*100)