|
Posted by Erland Sommarskog on 09/10/05 00:16
Jeffrey S via SQLMonster.com (forum@SQLMonster.com) writes:
> I have this script...I would like to group the total of project_amt_1
> (July) by the project_id and the same for the 11 months and the total.
It is unclear to me what you want. If all you want is the sum per
project and no information per component and cost_element, then
you can say:
select a.project_id, SUM(a.project_amt_1) as 'July',
SUM(a.project_amt_2) as 'August'
...
from component_monetary_balance as a, project as b, component as c
...
and project_ytd_amt <> 0
GROUP BY a.project_id
If this does not answer you question, could you please clarify with
an example?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|