Probbaly timestamp te does not come like timestamp to the DB because of BDE
probbaly.
Anyway.. These are untested, also it is good to have a look at SQL tutorial.
Here free one -
http://www.yqcomputer.com/
You have to use datepart function that is SQL Server's standart one.
Select CALLTIME, TOTALCALLS, ANSWEREDCALLS, RETURNCALLS, LOSTCALLS,
BPLANCALLS, CAMPONCALLS, DURATIONOFCALLS, QUEUETIMEOFCALLS,
PARKTIMEOFCALLS, CAMPONTIMEOFCALLS
From cdr_tickets
Where
(CALLTIME between '2004/04/16' and '2004/04/20') OR
(DatePart(hour,CALLTIME) between 10 and 13)
For the second one
select DatePart(year,CALLTIME) as call_year, DatePart(dayofyear,CALLTIME)
as call_dayofyear, sum(CALLTIME), sum(TOTALCALLS), sum(ANSWEREDCALLS)
from
cdr_tickets
Group by DatePart(year,CALLTIME) as call_year, DatePart(dayofyear,CALLTIME)
as call_dayofyear
Bojidar Alexandrov
0
7
2
18
46
3
9
0
9
0
44
43
0
0
0