Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Detail Formatting

Status
Not open for further replies.

rjoubert

Programmer
Oct 2, 2003
1,843
US
I have a query (Union query merging two Group By queries) which returns me something like this...

GroupName CountType Count
Group1 Accepted 10
Group1 Rejected 5
Group2 Accepted 15
Group2 Rejected 7
Group3 Accepted 21
Group3 Rejected 19

Now, I want to create a report that will show me the Accepted and Rejected counts per Group...on the same line.

GroupName Accepted Rejected
Group1 10 5
Group2 15 7
Group3 21 19

Is there anyway I can get each detail section to "merge" two records like that?

Thanks...
 
Would a crosstab query on the initial data work for you?
 
Not really. I seem to remember a way to create a second detail section in a report. That would be the ideal solution for me.
 
Why "Not really"? A query based on your union query that has GroupName as the Row Heading, CountType as the Column Heading, and sum of Count as the value is exactly what you are asking for.

You can also use a report with a 2-column subreport or write some code. I would consider the crosstab query the simplest solution. The others might be fun though.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I had abandoned the crosstab query idea prior to going down this road, because I had additional data (besides the Accepted and Rejected counts) that had to be incorporated. After going back to the crosstab query idea, I got it to work...thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top