Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    hbm001 is offline Novice
    Windows 2K Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9

    calculating On Hand Quantity

    Hi,



    I am having a problem in calculating the on hand quantity for a database recording books inventory for a small book store.

    So far I have 3 tables
    Table 1- Books
    Table 2 - Incoming Inventory (recorded per transaction)
    Table 3 - Outgoing Sales (recorded per transaction)

    I have a query calulating the total books incoming sorted by title and month , and another query for total books outgoing sorted by title and month.

    Now, I need to calculate on hand quantity , the filed for stock at physical count is in the "Books" table, and the total books incoming is in query 1, total books outgoing in query 2. How can i combine all 3 data items to get a formula for the on hand quantity in a new query.

    I've tried Alllen Browne's On hand quantity method - but its too complicated!

    Please help! First time using access.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Allen's method is a bit complicated. If you have the 2 queries already, add them along with the Books table to a new query. Edit the join between the queries and the Books table so you get all records from the Books table. That should let you bring the total in and out on one line with each book. That should let you calculate the on hand amount (you may need the Nz() function).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    hbm001 is offline Novice
    Windows 2K Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    thank you for the super quick reply.
    problem is that I can't use a previous query result in my new query. It won't let me add any field unless its a table. Is the join function going to solve this issue?

    Also, what does the Nz() function do?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can certainly use one query in another. Can you post the db here, or a representative sample?

    The join will make sure all products are included, whether or not they have records in the incoming or outgoing tables.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    hbm001 is offline Novice
    Windows 2K Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    The file is currently too big, sorry I can't send the full file, but here are the printscreens - hope they help.

    I want the new query to have the field "Stock" from tbl.Books , and results from the crosstab query.inventory for each title, for column 1,(month 1) and exactly the same required from query.sales for each title, or column 1 (month 1)

    database printscreen.pdf

    Quote Originally Posted by pbaldy View Post
    You can certainly useThe join will make sure all products are included, whether or not they have records in the incoming or outgoing tables.
    one query in another. Can you post the db here, or a representative sample?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Have you tried with the two queries not being crosstabs? Using a date criteria on both should let you get the inventory for any given point in time.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    hbm001 is offline Novice
    Windows 2K Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Hi,

    Could I please send you the database by email to help me out? I don't know how to do the join function. I tried to google a link that would teach me this, however none of them give you the option to join a table and query together.

    By the way, the option for removing crosstabs worked! thanks

    Quote Originally Posted by pbaldy View Post
    Have you tried with the two queries not being crosstabs? Using a date criteria on both should let you get the inventory for any given point in time.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sure:

    deleted to prevent spam
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    hbm001 is offline Novice
    Windows 2K Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Thanks,
    just emailed

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What is your expected result from the test db? I assume sales are transactions going out and inventory is coming in?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is this the expected result?
    Attached Thumbnails Attached Thumbnails OnHand.jpg  
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    hbm001 is offline Novice
    Windows 2K Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Yes this is very close to what im
    looking for, but basically the on hand quantity must also account for the field "stock" in table books. So on hand quantity = stock+ inventory - sales.

    Also would it be simple to calculate if the book is required to be reordered if each book has a different re-order point?

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    See if this does what you want. Adding a reorder point would be simple, presuming it's a field in the books table.
    Attached Files Attached Files
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    hbm001 is offline Novice
    Windows 2K Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    9
    Thank you! This is exactly it! And for re-order point, if it is a specified level in the books table, do I just create a new query subtracting Quantity on Hand with the re-order quantity? or is there a better way?

    Quote Originally Posted by pbaldy View Post
    See if this does what you want. Adding a reorder point would be simple, presuming it's a field in the books table.

  15. #15
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It can be in the same query or another. You'd simply be comparing on hand to the reorder point. If on hand is lower, it's time to reorder.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Left Hand column in chart empty
    By Kirsti in forum Reports
    Replies: 10
    Last Post: 03-20-2012, 01:41 PM
  2. Replies: 3
    Last Post: 10-13-2011, 08:40 AM
  3. free hand drawing in access? is it possible
    By MyWebdots in forum Access
    Replies: 1
    Last Post: 07-15-2011, 10:39 AM
  4. products and quantity
    By woody in forum Forms
    Replies: 2
    Last Post: 02-06-2011, 11:58 PM
  5. Total noob needs a helping hand?
    By Naz in forum Access
    Replies: 7
    Last Post: 01-28-2010, 08:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums