By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

Stock DB

P: 44
Hi am attempting to create a stock database for work. i have created a query called TotalStaffOrders and a query called TotalStockOrders this gives me the total of each item that has been ordered either for stock or staff. It displays total, StockDesc and Size. What i am attempting to do is subtract the totals from the staff table from the stock table where the descriptions are the same. Below is my attempt it does subtract but it subtracts from each value of the stock table.
Thanks for your help
Expand|Select|Wrap|Line Numbers
  1. SELECT [SumOfSSQuantity]-[SumOfQuantity] AS [Total Left], TotalStockOrders.StockDesc, TotalStockOrders.Size
  2. FROM TotalStaffOrders, TotalStockOrders
  3. GROUP BY [SumOfSSQuantity]-[SumOfQuantity], TotalStockOrders.StockDesc, TotalStockOrders.Size;
Dec 12 '11 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 446
Hi
There is no join statement in you query so it is impossible for Access to know how to relate TotalStaffOrders with TotalStockOrders.

Furthermore, if these two queries are already summing the items, I can't see why you want a Group By clause.

Perhaps, if you write out the details of these two queries, someone can help.

S7
Dec 12 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.