Problem with my query

john parlett 0 Reputation points
2024-02-07T20:27:33.8933333+00:00

I have a query that I run for my inventory. I have a work order form that lists a product (vault) that has been installed with a qty of 1 usually. I have a query based on that table that sums up the query. It also has productID in the query. I have a 2nd query that is based on a Stock In table. It also has productID and sums up the qtyrcvd field. I then have a 3rd query that shows ProductID, stockin: [sum of qty], stockout: [sum of qtyrcvd] and inventory: [stockin]-[stockout]. (3rd query and relationships shown in this image) screen1

Here is my issue. Everytime I run a report on my 3rd query, I show 2 entries for Monarch vaults (which I created two different work order forms at different dates, and 2 entries for Clark Silver Slate. The Stock out and inventory numbers are correct. I should have 22 stock in for Monarchs and 3 sold (stock out). My inventory should be 19, but I'm not sure why it shows it twice. Any ideas? screen2

Microsoft 365 and Office | Access | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. john parlett 0 Reputation points
    2024-02-07T20:47:17.1133333+00:00

    I resolved it by adding DISTINCT to the sql

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.