dbTalk Databases Forums  

Consolidating rows in a DB?

comp.databases.ms-access comp.databases.ms-access


Discuss Consolidating rows in a DB? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mmmGrubb
 
Posts: n/a

Default Consolidating rows in a DB? - 12-01-2004 , 12:32 PM






I have a printer log that I need to manipulate. Each row contains
document name and total # of pages in the document. Document names
contain various 12 digit alphanumberic codes.

I want to make a report that lists all rows with a common code in one
row with their page totals summed. So, what I want to do is make a
table that looks like this:

document total
AAAAAAA11111 3
AAAAAAA22222 4
AAAAAAA11111 9

look like this:

document total
AAAAAAA11111 12
AAAAAAA22222 4


It seems like this manipulation must be fairly common, but I can't
seem to figure it out by reading through Access's help.

I've tried search Google groups a bit, but it seems like
"consolidate", "group", "sort", "filter" all apply to something other
than what I'm trying to do.

Any help will be much appreciated, of course.

-mmmGrubb

Reply With Quote
  #2  
Old   
Bas Cost Budde
 
Posts: n/a

Default Re: Consolidating rows in a DB? - 12-01-2004 , 12:46 PM






mmmGrubb wrote:
Quote:
I have a printer log that I need to manipulate. Each row contains
document name and total # of pages in the document. Document names
contain various 12 digit alphanumberic codes.

I want to make a report that lists all rows with a common code in one
row with their page totals summed. So, what I want to do is make a
table that looks like this:

document total
AAAAAAA11111 3
AAAAAAA22222 4
AAAAAAA11111 9

look like this:

document total
AAAAAAA11111 12
AAAAAAA22222 4


It seems like this manipulation must be fairly common, but I can't
seem to figure it out by reading through Access's help.
With the query in design view (graphical), click the Sigma button on the
toolbar (tooltip is Totals in my version). That will cause an extra row
to appear in the lower pane with Totals options. For document, select
(leave) Group by; for total, a field name I am not too happy with,
select Sum.

With the query in SQL view, you could fumble a bit with the GROUP BY
clause. I formulate that this way because you either can figure out what
is in the statement after you've done the graphical manipulation, or you
are at home with SQL enough to know.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea


Reply With Quote
  #3  
Old   
PC Datasheet
 
Posts: n/a

Default Re: Consolidating rows in a DB? - 12-01-2004 , 12:47 PM



Create a new query based on your table. Include the document and total
fields. No sorting! Click on the Sigma (looks like E) button on the toolbar
at the top of the screen. Go back to your query and under total, change
Group By to Sum. Base your report on this query. With the report in design
view, click on the sorting and groupong button and sort on document.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource (AT) pcdatasheet (DOT) com
www.pcdatasheet.com


"mmmGrubb" <mgrubb (AT) sicolamartin (DOT) com> wrote

Quote:
I have a printer log that I need to manipulate. Each row contains
document name and total # of pages in the document. Document names
contain various 12 digit alphanumberic codes.

I want to make a report that lists all rows with a common code in one
row with their page totals summed. So, what I want to do is make a
table that looks like this:

document total
AAAAAAA11111 3
AAAAAAA22222 4
AAAAAAA11111 9

look like this:

document total
AAAAAAA11111 12
AAAAAAA22222 4


It seems like this manipulation must be fairly common, but I can't
seem to figure it out by reading through Access's help.

I've tried search Google groups a bit, but it seems like
"consolidate", "group", "sort", "filter" all apply to something other
than what I'm trying to do.

Any help will be much appreciated, of course.

-mmmGrubb



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.