Query to create multipe total fields

D

Decembersonata

Ok, I have a fairly basic table. The table lists an ID number, a budget
number, and a dollar amount. Some ID numbers have multiple budget numbers
and dollar amounts associated with them. My task is to create a Make Table
query that takes all the records and only have one row for each unique ID
number. For instances where the ID number has multiple rows associated with
it in the original table, I need to create additional columns (i.e.
budgetnumber1, total1, budgetnumber2, total2, etc.) so that all the data for
each individual can be viewed in one row. What is the best way to go about
structuring this query?
 
K

KARL DEWEY

I think a crosstab query will probably do what you need.

You did not give any sample data so it might work for you based on your data.
 
D

Decembersonata

I did go the CrossTab route first, the only issue I had was the number of
records it was drawing back (about 1800) caused the crosstab to error.
 
K

KARL DEWEY

I guess that you do not wish to post sample data.

What would the maximum quanity of budget numbers ever be?
 
D

Decembersonata

Sorry, the sample data is payroll related, so that's why I'm hesitant to post
that. 3000 budgets is up towards the maximum number.
 
D

Decembersonata

The maximum number of budgets would be something close to 3000. I'm not
posting sample data because the data is payroll related.
 
J

John W. Vinson

Sorry, the sample data is payroll related, so that's why I'm hesitant to post
that. 3000 budgets is up towards the maximum number.

So do you really want a report that's 2756 columns wide...!? How will anyone
read it?
 
J

John W. Vinson

Ok, I have a fairly basic table. The table lists an ID number, a budget
number, and a dollar amount. Some ID numbers have multiple budget numbers
and dollar amounts associated with them. My task is to create a Make Table
query that takes all the records and only have one row for each unique ID
number. For instances where the ID number has multiple rows associated with
it in the original table, I need to create additional columns (i.e.
budgetnumber1, total1, budgetnumber2, total2, etc.) so that all the data for
each individual can be viewed in one row. What is the best way to go about
structuring this query?

Let's step back a bit.

I doubt that you really want to print out a report with 6000 columns of budget
numbers and totals across the page!

What real-life business problem are you attempting to solve?

If you could create this enormously wide table (which you can't, not in Access
anyway since it's limited to 255 fields) what would you DO with it?

I'm certain that there is a different solution to your problem!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top