I have the query:
SELECT
STARTTIME, STARTTIME + INTRVL, MAX(I_STAFFTIME), ROW_DATE, 1800 - MAX(I_STAFFTIME) FROM hagent
WHERE
ACD=$acd AND ROW_DATE = [Data:] AND STARTTIME = [Orario:] AND (SPLIT=2 OR SPLIT=7 OR SPLIT=8 OR SPLIT=9 OR SPLIT=12 OR SPLIT=13 OR SPLIT=16 OR SPLIT=17 OR SPLIT=18 OR SPLIT=25 OR SPLIT=26 OR SPLIT=28 OR SPLIT=29 OR SPLIT=50 OR SPLIT=52 OR SPLIT=53) GROUP BY 1,3,5
I would insert SUM(MAX(I_STAFFTIME)) but I have the error:
The following is invalid in the SELECT clause: SUM(MAX(I_STAFFTIME))
How can I do?
Help me!!!
SELECT
STARTTIME, STARTTIME + INTRVL, MAX(I_STAFFTIME), ROW_DATE, 1800 - MAX(I_STAFFTIME) FROM hagent
WHERE
ACD=$acd AND ROW_DATE = [Data:] AND STARTTIME = [Orario:] AND (SPLIT=2 OR SPLIT=7 OR SPLIT=8 OR SPLIT=9 OR SPLIT=12 OR SPLIT=13 OR SPLIT=16 OR SPLIT=17 OR SPLIT=18 OR SPLIT=25 OR SPLIT=26 OR SPLIT=28 OR SPLIT=29 OR SPLIT=50 OR SPLIT=52 OR SPLIT=53) GROUP BY 1,3,5
I would insert SUM(MAX(I_STAFFTIME)) but I have the error:
The following is invalid in the SELECT clause: SUM(MAX(I_STAFFTIME))
How can I do?
Help me!!!