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!

SQL Statement Errors 1

Status
Not open for further replies.

needmoremoney

Technical User
Mar 30, 2005
123
0
0
US
Hello all I'm getting an error when I try to run this sql statement. The field "jobcode" is a text field. On the other hand, when I run the statement on a number field, the statement works fine. Any ideas, please let me know.

.....

SELECT EPayHist.id, EPayHistDetail.jobCode AS jobcodereg
INTO tempreport2
FROM (EPayHist
INNER JOIN EPayHistDetail
ON EPayHist.transaction = EPayHistDetail.transaction)
INNER JOIN CEarn
ON EPayHistDetail.detCode = CEarn.eCode
WHERE EPayHist.process >= [paramBeginProcess] AND
EPayHist.process <= [paramEndProcess] AND
EPayHistDetail.transactionType <> "X" AND
EPayHistDetail.det = "E" AND
CEarn.earnTypeCode = "Reg"
GROUP BY EPayHist.id;

UPDATE tempreport1
INNER JOIN tempreport2
ON tempreport1.id = tempreport2.id
SET tempreport1.jobcodereg = tempreport2.jobcodereg;

....

I get the error:

"You tried to execute a query that doesn't include the specified expression 'jobcode' as part of an aggregate function."

Any help.. thanks..much..
 
Get rid of this:
GROUP BY EPayHist.id

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top