Results 1 to 8 of 8
  1. #1
    andygriff is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    4

    HELP, query to list multiple records in a list from multiple queries,

    Good Day

    I have a DB where you there's 5 tables all linked together by one project ID

    tables below

    Project , Staff, Asset, allowances, travel, mark up

    what I can do is create a new project, then add records to each of the other tables on what different items I require,

    i.e. I create a new project - called project one, in the project table I create a record stating, name, time scale, client and location, then I add different records to each of the other tables on what I require all linked to the same project ID. (probably not explained that too well)

    now I want to create a query that lists all the requirements one after the other this will make it easier to create reports and to calculate costing's.



    at the moment I have made 5 different queries listing all the data, then have one report containing 5 sub reports to display the data, no this does work, but i'm sure theres a better way

    any help would be greatly appreciated

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    If Project is the 1 side of a 1-to-many relationship with each of the other tables, then the subreport approach is proper.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    andygriff is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    4
    that is correct, the project table is the key to all the other tables, i'm experimenting with a union query, would this work

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    No, UNION is not appropriate for parent/child records. You have applied the correct approach.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    andygriff is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    4
    that's not want I wanted to hear, at the moment ive got a union query listing all records I need, what I have done is taken out the project table from the query and just linked the rest with union all, seems to be working

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Don't understand. UNION query is used to combine like data. How is staff data like markup data?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    andygriff is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    4
    they are both linked to the same project

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    That doesn't mean the data is alike. UNION is used to combine up to 50 tables with like data. Example:

    SELECT AccountNo, Amount, TransDate, "Cash" AS TransType FROM tblCash
    UNION SELECT AccountNo, Amount, TransDate, "CC" FROM tblCC;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 06-20-2013, 12:09 PM
  2. Replies: 4
    Last Post: 05-08-2012, 10:04 AM
  3. Replies: 5
    Last Post: 04-20-2012, 10:07 AM
  4. Replies: 2
    Last Post: 02-28-2012, 12:43 PM
  5. Replies: 23
    Last Post: 12-06-2011, 09:18 AM

Tags for this Thread

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