Results 1 to 8 of 8
  1. #1
    jamtrad is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    4

    Supply and demand query

    Hi Folks


    This has got me stumped. I trying to build a query that will show me stores (Str) who have not sold items but that them on Hand (OH) to and match them to stores who have sold items and have none on hand. A kind of supply and demand. The table has 12 different stores and each store has the same items. So there are duplicates items and duplicate stores. So I have tried showing data to show stores that has not sold an item and have it OH and tried to join with Stores that have sold items do not have it on hand. When I link the items of both querys and I have tried Make tabel querys is does bring back the correct data.
    Hope this make sense to you. Thank you for your help.

    Qry Sold and OH (Ratio)
    StrItem#O/HSOLDExpr1primary KeyFTU4053310-11SAN4414310-12SAN441450113SAN441530004

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Do it bit by bit, slowly, and maybe at the end you can put it all in one, once you understand what is going on.

    - get a list (query) of all stores, group on store and item, sum OH, criteria OH = 0 and sold > 0
    - get a list of the opposite
    - now you have two lists - one for stores that have sold but have no OH, one of stores that have OH but not sold
    - join these two lists by item

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Damn - this was a duplicate!!

  4. #4
    jamtrad is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    4

    Supply and demand

    Thanks for you response. However that didn't work.

    Qry Sold and OH By item)StrItemSumOfO/HSumOfSOLDExpr1primary KeyNUmberBTF497211102671COT497210112682FTU4972120-22694SAN497211212705ST4972110-12667

    Here's some results from another query, as you can see FTU has 2 on hold (OH) and COT has sold one and none OH. How do I write a query to just pull Item 49721 needs to come from SAN and go to COT?

    Sorry for not being clear.

  5. #5
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    "However that didn't work."

    Which part exactly didn't work?

  6. #6
    jamtrad is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    4

    Supply and demand

    when you join the 2 queries, the results don't make sense.

  7. #7
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Qry Sold and OH By item)StrItemSumOfO/HSumOfSOLDExpr1primary KeyNUmberBTF497211102671COT497210112682FTU4972120-22694SAN497211212705ST4972110-12667
    This is hard to interpret because there is no formatting.

    Can you zip and post a copy of your database with any sensitive data removed? Perhaps that will give us a better idea of what you are after.

    Please make sure to provide the name of the query and/or tables that are pertinent to your issue.

  8. #8
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    OK. Let's go back a step. We have two lists, one for stores with OH and one for stores without. There isn't going to be a 1 to 1 match-up - one store on the left query might have 100 OH and three stores on the right query which need that stock. Or the opposite. So there maybe needs to be some manual input? Such as a form which displays these lists and you manually select which quantity goes to which store.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 35
    Last Post: 09-19-2011, 10:13 AM
  2. Form to supply parameters to a report
    By Ray67 in forum Reports
    Replies: 11
    Last Post: 07-22-2011, 02:06 PM
  3. Adding Part Number on demand that is not in table
    By patrickwelch in forum Programming
    Replies: 4
    Last Post: 03-21-2011, 07:53 PM

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