I make a request
select _sIDPRZ.idprz,name, polis.polistype, polisdate, COUNT(*) AS Kol from polis join _sIDPRZ on polis.idprz=_sIDPRZ.idprz where polistype=3 and polisdates between '2011-05-01 00:00:00' and '2012-10-31 23:59:59' and polis.polisdateF is null GROUP BY _sIDPRZ.idprz,name, polistype,polisdate order by _sIDPRZ.idprz,polistype, polisdate'
Gives an answer
idprz name polistype polisdate Kol 402 УПРЗ г. Вязьма 3 2011-06-14 00:00:00.000 2 402 УПРЗ г. Вязьма 3 2011-06-17 00:00:00.000 76 402 УПРЗ г. Вязьма 3 2011-06-20 00:00:00.000 18 ....... 413 УПРЗ п. Новодугино 3 2012-03-02 00:00:00.000 5 .......
QUESTION: how to arrange the correct sample by date, so that the answer is not issued for each day, but the total amount for a specific idprz
?