Results 1 to 5 of 5
  1. #1
    gkaro is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    18

    Post simple assistance needed

    Hi all, newbie here.
    Id like some help please.

    I have 2 tables with fields as follows:

    Table 1 (relatively fixed)
    Product


    Desired Inventory

    Table 2 (updated every week)
    Product
    Week
    Actual Inventory

    Id like a query to output the following:
    Product
    Week
    Desired Inventory
    Actual Inventory

    The problem that I am having is that for any week that a specific product has no Actual inventory reading I am not getting any output. I need to get every product listed whether or not an actual is present in
    I have 3 products A,B C with desired inventory of 30, 30, 30
    for week 10 I have an actual for A(20) & B(15) but nothing blank for C. Need the output to be:

    A wk10 30 20
    B wk10 30 15
    C wk10 30 (blank or 0) This is the line that I can not get


    thanks so much
    G

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think you need to change your table structure.
    Attachment 14085
    I would have a structure like above. In the attached dB, open Query1.

  3. #3
    gkaro is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    18
    Hi Steve,,,thanks for your reply.
    The example I gave was a very simplified example of what Im doing here.

    If I understand correctly, in Table 2, I need to match the key in Table 1 line by line for every product?
    I dont think this is realistic becasue Table 1 is a database of about 5,000 lines for combinations of various products and store locations.
    Table 2 is a table that gets updated every week with actual inventory data for each product by store. I append approx 20,000 lines per week in table 2.

    How would I ensure that the keys match?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by gkaro View Post

    How would I ensure that the keys match?
    It is up to you, as the developer, to maintain referential integrity.

    http://databases.about.com/cs/admini...fintegrity.htm

    You probably need more tables.


    .

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Sorry. You asked a specific question "How do I...", with example data. Based on what you provided, that is how I would do it.

    How would I ensure that the keys match?
    Without knowing more about your process, the best I can say is "It Depends". Is your table structure normalized? Are you importing the weekly data into one table? What is your process?


    You could try setting up a relationship on the "Product" fields, but it appears the "Product" fields are text type field. Relationships on text fields can be done, but they are slow compared to Long Integers.

    Does each product have a unique identifier? Maybe a UPC? Barcode?

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

Similar Threads

  1. Help! Very Simple Inventory Needed
    By jflorey in forum Access
    Replies: 7
    Last Post: 08-13-2013, 04:17 PM
  2. HELP! Simple map database needed to be done!
    By retired911 in forum Database Design
    Replies: 1
    Last Post: 01-10-2012, 04:51 PM
  3. Simple help needed
    By canfish in forum Database Design
    Replies: 10
    Last Post: 07-28-2010, 05:13 PM
  4. Replies: 4
    Last Post: 08-30-2009, 12:31 PM
  5. Query Assistance Needed
    By elotromanuel in forum Queries
    Replies: 1
    Last Post: 03-17-2009, 09:31 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