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!

MS Access query, ? Sum Issue

Status
Not open for further replies.

alan1203

Technical User
Mar 16, 2007
27
GB
Hi,

I have a simple Access query that Sums the number of items received and the number of items used, then uses an expression to calculate 'Received' - 'Used'.

The table that contains this data just has 'Date', 'PartNumber', 'Received', 'Used', 'OrderNumber' and 'Comments' fields.

I populate this table using the same form used as a subform in 3 different main forms.

My problem is that when I run the query, the same part number is shown 2 times, almost as if it is 2 separate numbers. When I go into the datasheet view on the query the two part numbers look the same.

I apologise if this is not a query problem and any help will be appreciated.

Alan
 
Hi,

Please post your query SQL.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thanks guys, here is the SQL

SELECT tblParts.PartDescription, tblParts.PartNumber, tblParts.Price, tblParts.Drawer, tblParts.Compartment, Sum(tblUsedRecd.Received) AS SumOfReceived, Sum(tblUsedRecd.Used) AS SumOfUsed, [SumOfReceived]-[SumOfUsed] AS Expr1, tblParts.[Do Not Re-order], tblParts.[For Info Only], tblParts.[Discontinued by Supplier], tblUsedRecd.Comments
FROM tblParts INNER JOIN tblUsedRecd ON tblParts.PartNumber = tblUsedRecd.PartNumber
GROUP BY tblParts.PartDescription, tblParts.PartNumber, tblParts.Price, tblParts.Drawer, tblParts.Compartment, tblParts.[Do Not Re-order], tblParts.[For Info Only], tblParts.[Discontinued by Supplier], tblUsedRecd.Comments
HAVING (((tblParts.Drawer)>"0"))
ORDER BY tblParts.Drawer, tblParts.Compartment;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top