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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple SUM() functions in a select?

Status
Not open for further replies.

CraigBest

Programmer
Aug 1, 2001
545
US
Cam you have more than one SUM() function in a select statement? I'm wondering because I can't seem to make it work with more than one SUM() in the select, but the errors I'm getting back (on the GROUP BY and HAVING clauses) don't specifically stare that it can't be done. Just wondering...?

CraigHartz
 
Jim, I'd love to but it's a sensitive bit of code and I'm not allowed to share it, company policy. Just knowing that it is indeed possible helps, thanks. I'll see if I can come up with a way of showing what I'm doing without posting the actual code (though I doubt that will be helpful to you).


CraigHartz
 
Thanks Jim, I figured it out - I had been trying to include the second SUM() statement as a part of the group by caluse, which was causing the error. I took it out (leaving only the primary SUM in the order by) and the statement compiled and ran fine.

CraigHartz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top