Over the next few days we are going to start the migration to a new forum application. I'm going to start with high post count and active users. You may receive an invitation to the new forums. It's not spam. It's just me trying to seed the user base. My goal is to open it up over the weekend.

Once we open the site we'll block registrations here. We should be open shortly on the new site.

SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query Help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

9 Posts

Posted - 08/10/2006 :  11:48:49  Show Profile  Reply with Quote
I'm trying to create a query using SUM. I'm obviously doing something wrong here. Any help?

SUM((CT.TotMaterialCost + CT.TotFreightCost) / (SUM(CT.OrigQty - CT.QtyUsed))) > '0'
Cannot perform an aggregate function on an expression containing an aggregate or a subquery.

Premature Yak Congratulator

22847 Posts

Posted - 08/10/2006 :  12:00:56  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Post your full query.
Also explain what you are trying to do


Failing to plan is Planning to fail

Edited by - madhivanan on 08/10/2006 12:01:55
Go to Top of Page

Flowing Fount of Yak Knowledge

Sri Lanka
1378 Posts

Posted - 08/10/2006 :  12:02:47  Show Profile  Reply with Quote
U have something like

Sum(.... Sum(...) ...)

U may need to change that to

Sum (DT.Sum_of_DerivedTbl) from
( Select Sum(....) as Sum_of_DerivedTbl from ....) as DT

-- Something else
> '0' should be > 0


Edited by - Srinika on 08/10/2006 12:03:37
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000