Subject Sum() on a subselect?
Author Joe Martinez
Is it not possible to do a sum() on a subselect?

I have the following query:

select proddept,
count(*) as thecount,sum(prodinventory) as theinv,
sum(prodprice*prodinventory) as price,
sum(vpcost*prodinventory) as cost,
sum(select sum(fifocost*fifoqty) from fifocosts where
fifobarcode=A.prodbarcode) as paidcost
from products A left outer join vendorproducts on vpupc=prodbarcode and
vpvendor=prodsource
group by proddept
order by proddept

It's saying "Token Unknown" on the "select" in the 5th line.

I'm basically trying to do a double grouping (two detail layers deep).

-Joe