Results 1 to 5 of 5
  1. #1
    DatabaseIntern is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    20

    Add/append data to crosstab query

    So I have made a crosstab query that works by taking the data off the "intersections" of data between to fields and mapping the "Module Names" as rows, and "MicroNames" as columns, from the MicroModules table. This part works well, but I was wondering if there was a way I could achieve this and include ALL Module names and Micronames even if they have no intersections (IE they are not in the micromodules table). I want this for totaling reasons mostly, and did not think of this when I first designed the DB - they question just sprung up in beta testing (I only have a few that dont have intersections, they are mostly "incomplete entries" but I have been asked to include them regardless)



    Here is a simplified version of my DB architecture:



    Click image for larger version. 

Name:	MicroModulesMap.png 
Views:	3 
Size:	24.8 KB 
ID:	8653

    Essentially I want ALL modules as Rows, and ALL Micros as Columns in the query, and still somehow have the information from MicroModules linking them together.

    Currenttly I have a query to give me all the modules not in micromodules, maybe there is a way I could append those on as rows? I am a little confused here about how how/if I can move forward. Please feel free to ask for clarifications or for any questions.


    Here is a VERY bad drawing of the ideal query I want - it looks similar to the one i have working, but it would include all the entries from the Modules table even if they had no link to MicroMods.

    Click image for larger version. 

Name:	IdealQuery.png 
Views:	2 
Size:	15.9 KB 
ID:	8654

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Try:

    Query 1 that includes both Modules and Micros tables WITHOUT a join clause. This will result in records for every possible combination of modules and micros pairs.

    Query 2 includes Query 1 and the MicroModules table WITH compound join on both the module and micro ID fields and join type 'Include all records from Query 1 ..."

    Query 3 would be a crosstab of Query 2.
    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
    DatabaseIntern is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    20
    I am sorry, I dont have much experience with advanced query design, I am confused at the first step, if I just try to include everything I get a type mismatch. could you explain a little more in depth how you would go about creating these particular queries?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Nothing really advanced about my suggestion, actually quite basic.

    The first query should just have the two tables in the query design frame. If a link is created, delete it. Do not want the query to have a join clause. Then drag only the ID field from each table to the field grid.

    Show the resulting SQL statement if you still have an issue.
    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
    DatabaseIntern is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    20
    Musta been running on too little sleep yesterday cause everything worked fine today, funny enough all I needed to do was change the join type on a query I already had (although I didnt realize that until I walked through making this other query). Its amazing what a little experience can do for you. Thanks for all your help, that push in the right direction saved me hours no doubt.

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

Similar Threads

  1. Query append data from another database
    By Eagle2012 in forum Access
    Replies: 2
    Last Post: 03-17-2012, 03:02 PM
  2. Replies: 1
    Last Post: 02-03-2012, 05:39 PM
  3. Error 3075 in Append Query with link data
    By wmeparker in forum Programming
    Replies: 1
    Last Post: 05-17-2011, 10:26 AM
  4. Replies: 5
    Last Post: 04-06-2011, 01:54 PM
  5. Crosstab Query Prompting twice for data?
    By AccessFreak in forum Queries
    Replies: 5
    Last Post: 01-07-2011, 10:38 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