General information
Category:
Coding, syntax & commands
Hello,
In the following sql statement, I want to calculate total phone calls for each extension in a week. Can someone look at the sql statement and tell me why is the return value for each day is the same for each extension. For example, ext.# 224, the return value will be 200 calls for everyday, ext.# 500, the reurn value will be 10 calls for each day:
select alltrim(f_name) + " " + alltrim(l_name) as staff, ext, DEPT, sum(iif(cdow(start)= "Monday",LENGTH,0)) AS MON,;
sum(iif(cdow(start+1)= "Tuesday",LENGTH,0)) AS TUES, ;
sum(iif(cdow(start+2)= "Wednesday",LENGTH,0)) AS WED, ;
sum(iif(cdow(start+3)= "Thursday",LENGTH,0)) AS THU,;
sum(iif(cdow(start+4)= "Friday",LENGTH,0)) AS FRI ;
FROM STAFF, CALL_DET WHERE EXT == CALL_STN AND upper(alltrim(ACTION)) == "INCOMING CALL" GROUP BY EXT into cursor temp
thanks
sherry
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only