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

sum of column 1 / sum of colum 2 (repost)

Status
Not open for further replies.

wshm

Programmer
Dec 7, 2006
62
US
i am trying to fund a sum of c1 and
divide by sum of c2 to find 'estUnitCost'

maybe something like..

UPDATE tbl_EstUnitcost SET EstUnitcost
,sum(estcost)/sum(estprodunit) as estunitcost
FROM tbl_EstUnitCost
Group By tbl_EstUnitCost.DeptBudNo;

EstUnitCost should be sum of 'estcost divide by
sum of 'estprodunit'

i know the syntax is wrong.. but i think you
can get the idea of what i am thinking..
any help will be appreciated..
 
sigh.. just realized i don't need to do sum.
so all worked out now /w

UPDATE tbl_EstUnitcost SET tbl_estunitcost.estunitcost = ([estcost]/[estprodunit])

=)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top