Results 1 to 4 of 4
  1. #1
    Bobo73 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2016
    Posts
    2

    Fill up not available data with 0

    Hi to all,
    I am happy to be part of the Access comunity now =) But I am at a point where intensive google approaches coul not help me out any more. I am sure, that this task is not that hard, but it is juts hard to google for this specific problem. Thats why I am asking you for help now.



    In my database, there is a table wich lists all orders which looks like this:

    Orders
    Date warehouse ProductID QTY
    01.01.2016 1 1 20
    03.01.2016 1 1 30
    04.01.2016 1 2 22
    ... ... ... ...

    There are several warehouses and products. all products can be ordered in all warehouses. I want to know the damand data for every day in every warehouse for every product.
    Therefore I need to create a querie which create new tuples for each day whithout demand in any warehouse and fills up the demand for that day with "0".
    The output schould look like this:

    Demand
    Date warehouse ProductID QTY
    01.01.2016 1 1 20
    02.01.2016 1 1 0
    03.01.2016 1 1 30
    04.01.2016 1 1 0
    ... ...
    01.01.2016 1 2 0
    02.01.2016 1 2 0
    03.01.2016 1 2 0
    04.01.2016 1 2 22

    Do you have any idea to realise a querie like this?

    Thank You!

    Bobo

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    from the data supplied

    google 'access reserved words'
    google 'sql left joins'
    google 'sql Cartesian joins'

    from what you are asking, you will need 4 tables, the one provided, plus one that contains all products, another that contains all warehouses and the last one to contain all dates

  3. #3
    Bobo73 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2016
    Posts
    2
    Thanks a lot!
    I had to try different combinations of the joins, and when to use the cartesian join and when the left join, but finally i found a good solution! Thank you!

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Bobo73,

    Would you like to share your solution? Someone else may have the same/similar issue in future, and having a documented solution in the forum may be useful.

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

Similar Threads

  1. Fill fields from other data entries
    By alleurokyle in forum Queries
    Replies: 3
    Last Post: 02-11-2016, 03:24 AM
  2. Auto fill Data number between tables
    By Parvinder in forum Access
    Replies: 1
    Last Post: 02-07-2014, 05:18 PM
  3. Replies: 2
    Last Post: 12-18-2012, 11:41 AM
  4. Fill textboxs with data from a query
    By Bkgabbert in forum Queries
    Replies: 1
    Last Post: 05-25-2012, 04:09 AM
  5. Replies: 1
    Last Post: 12-21-2011, 02:11 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