Results 1 to 8 of 8
  1. #1
    jerickson.mn is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    2

    Trouble extracting data from multpile tables (poorly designed relationships?)

    Hi All, I've just started in a position where I will have to do loads of reporting, and I'm finding my Access skills sub par at best.



    Here is my dillema... The common theme between the tables (shown in the example) is the EEID. I would like some information from the "Macro Usage" table (EEID, Date, Macro Name) and some info from the production table (Hours in Production, Volume, VPH, and VPH to goal)

    I can not for get access to generate a query combining information. Any ideas?

  2. #2
    Join Date
    May 2010
    Posts
    339
    jerickson.mn,

    What you have here is poorly designed tables. So what follows is a poor relationships, querys, reports and so on.

    1. The field name Date is a Access reserved word so is Time.
    2. You Don't have a primary key. (EEID) this might serve as one, not sure.
    3. You have Date in two tables.
    4. Spaces in your field names will make coding harder.."Hours in Production" should be HoursInProduction.
    What I am try to say here is your putting the cart before the horse..if nothing else get your tables RIGHT. Life will be a whole lot easier for you.

  3. #3
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    In your relationship diagram you have both tables and have joined them by "EEID" and "Date"; however, in the "Production" table the "Date" datatype is text, while in the "Macro Usage" table the data type for "Date" is Number. This is the reason your query won't run.

    Here are some other pointers:

    - Don't name your fields with reserved words like "Date" or "Time".
    - Use Primary keys in your tables.
    - It's usually and advantage to match fields with the data types they hold. e.g. Date fields with Date/Time, or numerical fields with Number.

    Cheers,

  4. #4
    Join Date
    May 2010
    Posts
    339
    Double barrel!!

  5. #5
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Yup, but you were quicker on the draw!

  6. #6
    jerickson.mn is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    2
    Thank you all. Good Information. Sadly, I believe I'm tied to all the table formats, as the data is imported through csv files. This data all originally comes from other sources, not related to access. I am very new, and appreciate all of your input.

    Primary Key's - I'm struggling to set one in the production table, as the there are multiple entries for each EEID.

    AccessBlaster -- can I change Access reserved fields like "Date" to "DateUsed" or can I not use the word "Date" at all.

    AccessBlaster & ConneXion Lost, if I post a revised layout, would it be possible for you to review them?

    Thank you very much for your help.

  7. #7
    Join Date
    May 2010
    Posts
    339
    jerickson.mn,

    My short answer would be to Export the table out to the desktop in Excel format I use 97-2000. Then break the relationships empty the table and retool. Then I would open the Excel file on your desktop and match the columns to the new table fields and import. That is a short answer the reality may be different. Also you would have to match the .CSV column heads.

  8. #8
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    If the csv format is always the same, then you can take Access_Blaster's route to clean the data, or you may even be able to do the same thing within Access. In either case, it isn't necessary to return the results to the same table. You could treat your existing tables as "csvdatadump" tables, then import and convert to some proper "production" & "Macro_Usage" tables.

    Help with reviewing database layouts? Well yes, it's why we're here!

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

Similar Threads

  1. Extracting text from XML data
    By rob4465 in forum Access
    Replies: 1
    Last Post: 03-18-2010, 06:41 PM
  2. Extracting data after a keyword
    By KerryA in forum Queries
    Replies: 1
    Last Post: 02-11-2010, 09:56 PM
  3. Extracting data from a disastrous excel-style Table
    By milehighfreak in forum Import/Export Data
    Replies: 2
    Last Post: 12-16-2009, 07:13 AM
  4. 8 Tables with Relationships
    By bigdogxv in forum Access
    Replies: 1
    Last Post: 12-09-2009, 09:37 PM
  5. Replies: 0
    Last Post: 08-16-2008, 09:10 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