Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me with CMS!!!

Status
Not open for further replies.

qzat4

Technical User
Nov 8, 2012
21
0
1
IT
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!!!
 

Don't think you can group by a summed field.

So with your change if your select is now:

SELECT
STARTTIME, STARTTIME + INTRVL, sum(MAX(I_STAFFTIME)), ROW_DATE, 1800 - MAX(I_STAFFTIME) FROM hagent

Change your group by to:

GROUP BY 1,5

- Stinney

I love learning and passing on knowledge. "Because knowing is half the battle".... GI JOOOOOE!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top