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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a report based on a summary result

Status
Not open for further replies.

vasu1211

Technical User
May 10, 2007
21
US
hi

My report has fields - customer, origin city, origin state and price. The report has been grouped by customers. Every group of records has been summarized by adding the price field using sum function.

Now i want to sort the entire report not by customer field but by the result of the sum function. i.e the report should start with the group which has the highest total price.

How to do this?please help
 
You can't do this in your report as it stands. You can create a totals query that derives the values you want to sort on. Add this totals query to your report's record source and include the SumOfPrice in the report's field list so you can use it to sort.

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]
 
how to create totals query and how to add it to reoord source. now the record source is different? if i change it doesn't it change the entire report- please help
 
I'm not sure what you are asking. Do you not understand how to create a totals query? If so, did you check Help?

Maybe you should provide the current sql view of the report's record source.

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]
 
how do i give you the SQL view of a report. i am really new to this . please help.

thanks
 
You view the properties of the report and find the Record Source property. This is usually a table or query or SQL statement. If it is not a table, you should be able to view the record source in SQL view. Copy and paste the sql statement into a reply here.

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 will work on that- but related to the same project, i want to export the report to Excel What is the easiest way to do that? I try to do this- File-> Export but in doing this i lose some of the formatting particularly the summary part of a report like sum or average- they come out as errors on a sproeadsheet.

Please help thanks
 
A new question warrants a new thread.

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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top