Error in Dsum

confuse

Registered User.
Local time
Today, 09:11
Joined
Jul 17, 2008
Messages
49
Hi To all!! I need again your help guyz... I have an error in my query which i name it Product Sold Query, it is compose of 3 tables named: Inventory Transactions Query, Order Details and products which the 2 tables are being related.

In Inventory Transactions Query fields are:
ProductID
Name
Unitsreceived
TotalReceived

Order Details

ProductID
Name
Quantity
Total


I use this formula to add all the value of product sold with the same productID

ProductSold: DSum("[Quantity]","Order Details","ProductID =" & [Inventory Transactions Query].ProductID)


But it give me error, that this is not part of aggregate function...

Please do help i got headache with this...

Thanksss
 
tnx for immediate reply bob....

attached here my sample database....

thanks again...
 

Attachments

Try this:

Code:
SELECT
    Products.ProductID
  , Products.ProductName
  , Products.ProductDescription
  , DSum("[Quantity]","Order Details Petshop","ProductID =" & [Inventory Transactions Query].[ProductID]) AS ProductSold
  , [Inventory Transactions Query].UnitsReceived
  , [Order Details Petshop].Quantity
FROM
   (Products 
INNER JOIN
   [Inventory Transactions Query] 
ON
   Products.ProductID = [Inventory Transactions Query].ProductID) 
INNER JOIN
   [Order Details Petshop] 
ON
   Products.ProductID = [Order Details Petshop].ProductID
GROUP BY
   Products.ProductID
  , Products.ProductName
  , Products.ProductDescription
  , DSum("[Quantity]","Order Details Petshop","ProductID =" & [Inventory Transactions Query].[ProductID])
  , [Inventory Transactions Query].UnitsReceived
  , [Order Details Petshop].Quantity;

Bob
 

Users who are viewing this thread

Back
Top Bottom