I am trying to get this query using a derived table and an aggregate function to work in Excel Query:
But I get a generic error. So I broke it up into two queries - one stripped of the derived table and the other stripped of the aggregate function - to try and isolate the problem:
1.
2.
They both worked fine. But when I combine them I get the error again.
Thank you so much!
Code:
select purordcom.* from (select purOrdDet.PurAcct, sum(PurOrdDet.ExtCost),PurOrdDet.PONbr from AEMApp.dbo.PurOrdDet PurOrdDet group by PurOrdDet.PurAcct,PurOrdDet.PONbr) as PurOrdCom
1.
Code:
select PurOrdCom.* from (select PurOrdDet.PurAcct,PurOrdDet.ExtCost,PurOrdDet.PONbr from AEMApp.dbo.PurOrdDet PurOrdDet) as PurOrdCom
Code:
select purOrdDet.PurAcct,sum(PurOrdDet.ExtCost),PurOrdDet.PONbr from AEMApp.dbo.PurOrdDet PurOrdDet group by PurOrdDet.PurAcct,PurOrdDet.PONbr
Thank you so much!
Comment