keybs
10-20-2004, 02:53 PM
Below is a statement that works well for me, but I also need fields MatOnHand.PNDesc and MatOnHand.UM to be included. When I do include these fields in the SELECT statement I get:
"You tried to execute a query that does not include the specified expression 'PNDesc' as part of an aggregate function"
MatOnHand.PN is a part number and I need MatOnHand.PNDesc to describe the PN. Is this possible?
MatRS.Open "SELECT MatOnHand.PN, sum(MatTran.Quant) as Quantity, sum(MatTran.cost) as Cost FROM MatTran INNER JOIN MatOnHand ON MatTran.MatNo = MatOnHand.MatNo WHERE MatTran.billed = false AND MatOnHand.Vendor ='" & vendor & "' Group By MatOnHand.PN", MatCN, adOpenKeyset, adLockReadOnly
Thanks,
Brandon
"You tried to execute a query that does not include the specified expression 'PNDesc' as part of an aggregate function"
MatOnHand.PN is a part number and I need MatOnHand.PNDesc to describe the PN. Is this possible?
MatRS.Open "SELECT MatOnHand.PN, sum(MatTran.Quant) as Quantity, sum(MatTran.cost) as Cost FROM MatTran INNER JOIN MatOnHand ON MatTran.MatNo = MatOnHand.MatNo WHERE MatTran.billed = false AND MatOnHand.Vendor ='" & vendor & "' Group By MatOnHand.PN", MatCN, adOpenKeyset, adLockReadOnly
Thanks,
Brandon