Stock DB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 315hughes
    New Member
    • Nov 2011
    • 44

    #1

    Stock DB

    Hi am attempting to create a stock database for work. i have created a query called TotalStaffOrder s and a query called TotalStockOrder s 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
    Code:
    SELECT [SumOfSSQuantity]-[SumOfQuantity] AS [Total Left], TotalStockOrders.StockDesc, TotalStockOrders.Size
    FROM TotalStaffOrders, TotalStockOrders
    GROUP BY [SumOfSSQuantity]-[SumOfQuantity], TotalStockOrders.StockDesc, TotalStockOrders.Size;
    Last edited by NeoPa; Dec 13 '11, 01:07 AM. Reason: Fixed tags
  • sierra7
    Recognized Expert Contributor
    • Sep 2007
    • 446

    #2
    Hi
    There is no join statement in you query so it is impossible for Access to know how to relate TotalStaffOrder s with TotalStockOrder s.

    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

    Comment

    Working...