HOUPE
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору select D.CLOSEDATE as Date, datepart(hh,D.CLOSETIME),count(*)as [count] as hour from D where D.CLOSEDATE='01.01.2008' and (datepart(hh,D.CLOSETIME) between 9 and 20) group by D.CLOSEDATE , datepart(hh,D.CLOSETIME) order by datepart(hh,D.CLOSETIME) Добавлено: LMaxP select D.CLOSEDATE as Date, datepart(hh,D.CLOSETIME),count(*)as [count] as hour from D where D.CLOSEDATE='01.01.2008' and (datepart(hh,D.CLOSETIME) between 9 and 20) group by D.CLOSEDATE , datepart(hh,D.CLOSETIME) order by datepart(hh,D.CLOSETIME) date hour count 2008-01-01 00:00:00.000 9 48 2008-01-01 00:00:00.000 10 27 2008-01-01 00:00:00.000 11 79 2008-01-01 00:00:00.000 12 152 2008-01-01 00:00:00.000 13 561 2008-01-01 00:00:00.000 14 18 2008-01-01 00:00:00.000 15 17 2008-01-01 00:00:00.000 16 991 2008-01-01 00:00:00.000 17 7804 Что какается ФР - обладает компонентами для формирования групп по условию, подстчета значений по агрегатным функциям и тд. |