Работа над написанием SQL-запроса, который бы группировал время на 15-минутном интервале. Так, например, если транзакция происходит в 08:09, я хочу, чтобы она находилась в диапазоне от 08:00 до 08:15 и т. Д.
Я, честно говоря, не уверен, что делать с вытягиваниеминтервал, основанный на времени начала (CDR_CALLS.STARTDATETIME) вызова
Select CASE when CDR_CALLS.DN = '9370' then ‘Location 1’
when CDR_CALLS.DN = '9371' then ‘Location 2’
when CDR_CALLS.DN = '9372' then ‘Location 3’
when CDR_CALLS.DN = '9373' then ‘Location 4’
when CDR_CALLS.DN = '9374' then ‘Location 5
when CDR_CALLS.DN = '9375' then ‘Location 6’
when CDR_CALLS.DN = '9376' then ‘Location 7’
when CDR_CALLS.DN = '9377' then ‘Location 8’
when CDR_CALLS.DN = '9378' then ‘Location 9’
when CDR_CALLS.DN = '9379' then ‘Location 10’
else ‘No Location Defined’
END AS TRANSFER_TO,
CDR_CALLS.DNIS,
CDR_CALLS.ANI,
CDR_CALLS.LANG,
CDR_CALLS.CDR_LAST_MENU,
CDR_CALLS.ROUTE_CODE,
CDR_CALLS.CDR_END_CODE,
CDR_CALLS.STARTDATETIME,
CONVERT(char(10),CDR_CALLS.STARTDATETIME,101) as Date,
CONVERT(char(20),CDR_CALLS.STARTDATETIME,108) as Interval_Time,
CDR_CALLS.ENDDATETIME,
CDR_MENU_OPTION_DESC.MENU_ID,
CDR_MENU_OPTION_DESC.OPTION_ID,
CDR_MENU_OPTION_DESC.MENU_OPTION_DESC
from CDR_CALLS
FULL OUTER JOIN CDR_MENU_OPTION_DESC ON CDR_CALLS.CLIENT_ID = CDR_MENU_OPTION_DESC.CLIENT_ID
where OPTION_ID = '8'