select
('+' || a.PhoneArea || '-' || a.PhoneNumber) as DisplayName,
(Cast(cast((a.FinishedAt$DATE - a.AlertedAt$DATE)*86400 as Integer) as Varchar(10)) || 's') as Description,
a.AlertedAt$DATE as Date$Date,
a.ID as ID,
'0000000000' as FirmID
from CCCallHistoryItems a
where (a.Result_ID =:ID)
and a.ResultType = 3
and (((AlertedAt$DATE >= :DateFrom) and (AlertedAt$DATE < (:DateTo + 1))) or
((FinishedAt$DATE >= :DateFrom) and (FinishedAt$DATE < (:DateTo + 1))))Generated by ABRA Software a.s. 27.10.2021 16:35:09