Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2012
    Posts
    74

    Report Assistance - Fields from different tables with no relationship

    Hey guys and gals,

    I have multiple tables with absolutely no relationship to each other. They record completely different things, therefore I wouldn't think a relationship is needed whatsoever. The primary key is an ID autonumber on all of the tables.

    I'm trying to create a report that will sum one field from each table. I've tried creating a query with a field from each table, for the recordsource. When I run the query however, it lists the same information multiple times. It seems to do this because there aren't the same number of records in each table, so it seems to fill the gaps by just duplicating information.

    I'm not sure how to create the query so that I can use it as the record source for my report.

    Any thoughts?
    Version: Access 2010

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,177
    What you're getting is correct and normal.

    In your report, use the master table for header info (e.g. customer name) and the detail table for the detail info (e.g. orders table). Access knows not to repeat the header info.

    Caution, however; if you have more than one detail table, such as PO as master, and invoice and PO changes as two completely separate detail tables reporting to PO, you will need to use sub-reports instead of a simple layout.

    Sam

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,275
    Quote Originally Posted by Pis7ftw View Post
    Hey guys and gals,

    When I run the query however, it lists the same information multiple times. It seems to do this because there aren't the same number of records in each table, so it seems to fill the gaps by just duplicating information.

    I'm not sure how to create the query so that I can use it as the record source for my report.

    Any thoughts?
    Check how you are grouping your data and sumiing it
    not see the query I think you are grouping the ID just take the First or last one and sum the Numbers you want to total.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    779
    Also if some of the results are giving you multiple or repeat rows of data that you only need to see once - change the join type
    example
    select table1.* from table1
    INNER JOIN table2 ON table1.ID = table2.id

    this shows where both sides ID are equal - possibly giving multiple or repeat records but if you change it to

    select table1.* from table1
    Left JOIN table2 ON table1.ID = table2.id

    you would only get all the rows from table1 and related data from table2 that is relevant to table1 not repeating rcords where both sides are equal.

    This may help you recordsource of the report.
    Dale Houston, TX

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •