Probbaly timestamp te does not come like timestamp to the DB because of BDE
Anyway.. These are untested, also it is good to have a look at SQL tutorial.
Here free one -
You have to use datepart function that is SQL Server's standart one.
Select CALLTIME, TOTALCALLS, ANSWEREDCALLS, RETURNCALLS, LOSTCALLS,
BPLANCALLS, CAMPONCALLS, DURATIONOFCALLS, QUEUETIMEOFCALLS,
(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)
Group by DatePart(year,CALLTIME) as call_year, DatePart(dayofyear,CALLTIME)