Hi All,
I have a small problem I'm trying to solve with SELECT.
I thought I should be able to sum while issuing a select. When I issue the following command:
So my intent here is to get the Expense Purpose summed into a table or cursor (in this example I've forced in EXPENSEID = 81 so that it just looks at one expense report).
The problem is I get an error stating Missing or invalid GROUP BY clause. When I add:
I get the exact same error message.
Is SUM not compatible with SELECT?
Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS
"I try to be nice, but sometimes my mouth doesn't cooperate.
I have a small problem I'm trying to solve with SELECT.
I thought I should be able to sum while issuing a select. When I issue the following command:
Code:
SELECT EXPENSETYPE, EXPENSEPURPOSE, SUM(expenseconvertedto) AS EXPACCUM FROM EXPENSEDETAIL WHERE EXPENSEID = 81
So my intent here is to get the Expense Purpose summed into a table or cursor (in this example I've forced in EXPENSEID = 81 so that it just looks at one expense report).
The problem is I get an error stating Missing or invalid GROUP BY clause. When I add:
Code:
SELECT EXPENSETYPE, EXPENSEPURPOSE, SUM(expenseconvertedto) AS EXPACCUM FROM EXPENSEDETAIL WHERE EXPENSEID = 81 GROUP BY EXPENSEPURPOSE
I get the exact same error message.
Is SUM not compatible with SELECT?
Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS
"I try to be nice, but sometimes my mouth doesn't cooperate.