Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a table of data, in Microsoft Access 2003, listing multiple rows for each person.

I want to conditionally summarize a subset of these rows for each person, for instance, if entry for columnA = "Hats".

I've made summary tables for each (with the conditional checking) and I want to UNION the master table and the summary tables together, however each table has a different number of columns. Am I going to have to redesign my summary tables so they match the columns in the master, or is there a clever way of doing this?

I've tried to join them first (do I even need to do this?), and also to UNION CORRESPONDING them together, but MS Access doesn't understand that command it seems.

How should I do this?

Edit, here is a mockup of my master table data:

ResID| Name|  Baselocation|  Destination| CustomerID  |   Project ID    p1    p2    p3
---------------------------------------------------------------------------------
001  |  Bob|  London      |  D-London   | Company     |   "BaseWork"    X%    y%    z%
                             N/A        | myOwnCompany|   "Overhead"    x%    y%    z%
                             D-NotLondon| Company     |    Project      x%    y%    z% 
                             D-London   | Company     |    Project2     x%    y%    z%
share|improve this question
    
It would really help if you showed us what your tables look like. –  Leigh Riffel Aug 10 '12 at 12:14
    
Duplicate cross-post stackoverflow.com/questions/11888126/… –  Remou Aug 10 '12 at 16:30
    
@Remou, apologies for the cross post, I know this is in poor taste. I'm not sure what I was thinking when I posted this. –  Pureferret Aug 10 '12 at 16:50

1 Answer 1

I'd also like to see the ERD (Entity Relationship Diagram) to get a better understanding of your problem.

I'm thinking if you're creating a report to present the data in this fashion, you can setup a grouping based on an expression, either using built-in functions or use a user-defined function in a VBA module.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.