473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

sum() in report footer destroys detail order

I have a report based on:

PARAMETERS Forms!frmProductions!ProdID Long;
SELECT Sum(qryRoleEvent.Fee) AS SumOfFee, First(qryMusician.LastName) AS
LastName, First(qryMusician.FirstName) AS FirstName
FROM (qryEvent INNER JOIN qryRoleEvent ON qryEvent.EventID =
qryRoleEvent.EventID) INNER JOIN qryMusician ON qryRoleEvent.MusoID =
qryMusician.MusoID
WHERE (((qryEvent.ProdID)=[Forms]![frmProductions]![ProdID]))
GROUP BY qryMusician.MusoID
ORDER BY First(qryMusician.LastName), First(qryMusician.FirstName);

It's the total each musician gets paid for a series of concerts which are
part of the production.

If I have text control in the report footer, =Sum([SumOfFee]), (i.e. total
budget for that production), I lose the sorting in the detail section. The
detail is a list of the musicians and their total fee.

If I move the text control into the page footer no problem.

Anybody got any idea why?

I can correct it with sorting and grouping for the detail. But I'd like to
know why.

Cheers, Mike
Nov 12 '05 #1
6 2675
Mike MacSween wrote:
I have a report based on:

PARAMETERS Forms!frmProductions!ProdID Long;
SELECT Sum(qryRoleEvent.Fee) AS SumOfFee, First(qryMusician.LastName) AS
LastName, First(qryMusician.FirstName) AS FirstName
FROM (qryEvent INNER JOIN qryRoleEvent ON qryEvent.EventID =
qryRoleEvent.EventID) INNER JOIN qryMusician ON qryRoleEvent.MusoID =
qryMusician.MusoID
WHERE (((qryEvent.ProdID)=[Forms]![frmProductions]![ProdID]))
GROUP BY qryMusician.MusoID
ORDER BY First(qryMusician.LastName), First(qryMusician.FirstName);

It's the total each musician gets paid for a series of concerts which are
part of the production.

If I have text control in the report footer, =Sum([SumOfFee]), (i.e. total
budget for that production), I lose the sorting in the detail section. The
detail is a list of the musicians and their total fee.

If I move the text control into the page footer no problem.

Anybody got any idea why?

I can correct it with sorting and grouping for the detail. But I'd like to
know why.

Cheers, Mike

I don't know if this addresses your question. The ORDER BY is not
needed in the query. You set the sort order in a report from the menu
(View/Sorting And Grouping). It's the only way I know to ensure you get
a correctly sorted report.

Nov 12 '05 #2
"Salad" <oi*@vinegar.com> wrote in message
news:SL*******************@newsread1.news.pas.eart hlink.net...
Mike MacSween wrote: I don't know if this addresses your question. The ORDER BY is not
needed in the query. You set the sort order in a report from the menu
(View/Sorting And Grouping). It's the only way I know to ensure you get
a correctly sorted report.


Is that the generally accepted method then? Use sorting in the report and
don't bother trying to sort in the query?

Mike
Nov 12 '05 #3
Mike MacSween wrote:
"Salad" <oi*@vinegar.com> wrote in message
news:SL*******************@newsread1.news.pas.eart hlink.net...
Mike MacSween wrote:


I don't know if this addresses your question. The ORDER BY is not
needed in the query. You set the sort order in a report from the menu
(View/Sorting And Grouping). It's the only way I know to ensure you get
a correctly sorted report.

Is that the generally accepted method then? Use sorting in the report and
don't bother trying to sort in the query?

Mike

Yes. If you have been getting any kind of a sort in past reports without
using the sorting and grouping from the menu...or when you set it up via
the report wizard...consider yourself lucky. I have used a query that
is sorted that displayed in descending order when the query is in
ascending order. Without using the Sorting & Grouping menu option you
really have no control on the order.

Nov 12 '05 #4
It actually does some of those 'sums' (as well as the sorting
and grouping stuff) by rewriting the base query. It's much
more efficient that way of course, but it means that you can't
use the base query order when writing a report.

(david)
"Mike MacSween" <mi***********************@btinternet.com> wrote in message
news:40***********************@news.aaisp.net.uk.. .
I have a report based on:

PARAMETERS Forms!frmProductions!ProdID Long;
SELECT Sum(qryRoleEvent.Fee) AS SumOfFee, First(qryMusician.LastName) AS
LastName, First(qryMusician.FirstName) AS FirstName
FROM (qryEvent INNER JOIN qryRoleEvent ON qryEvent.EventID =
qryRoleEvent.EventID) INNER JOIN qryMusician ON qryRoleEvent.MusoID =
qryMusician.MusoID
WHERE (((qryEvent.ProdID)=[Forms]![frmProductions]![ProdID]))
GROUP BY qryMusician.MusoID
ORDER BY First(qryMusician.LastName), First(qryMusician.FirstName);

It's the total each musician gets paid for a series of concerts which are
part of the production.

If I have text control in the report footer, =Sum([SumOfFee]), (i.e. total
budget for that production), I lose the sorting in the detail section. The
detail is a list of the musicians and their total fee.

If I move the text control into the page footer no problem.

Anybody got any idea why?

I can correct it with sorting and grouping for the detail. But I'd like to
know why.

Cheers, Mike

Nov 12 '05 #5
"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
It actually does some of those 'sums' (as well as the sorting
and grouping stuff) by rewriting the base query. It's much
more efficient that way of course, but it means that you can't
use the base query order when writing a report.


Thanks David.

Yes, it's rapidly becoming clear that there's no point setting any sort of
order in the base query for a report, as the report will decide for itself.
And Access reports have got pretty good sorting and grouping anyway.

Mike
Nov 12 '05 #6
Mike MacSween wrote:
"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:40***********************@news.syd.swiftdsl.c om.au...
It actually does some of those 'sums' (as well as the sorting
and grouping stuff) by rewriting the base query. It's much
more efficient that way of course, but it means that you can't
use the base query order when writing a report.

Thanks David.

Yes, it's rapidly becoming clear that there's no point setting any sort of
order in the base query for a report, as the report will decide for itself.
And Access reports have got pretty good sorting and grouping anyway.

Mike


Here is another trick I employ if the report footer places the values
far below a value. It is also very handy in setting up multi-column
reports and you want heading above each column.

In the report query, I create a column called Master with the value of
M...or whatever value you want.

My first sort grouping is on Master and I create a footer for the Master
group. I move the report footer fields to the Master footer. This
makes the ending count get closer to the last record printed and is more
presentable.

For multi-column reports, the first sort is on Master. I make it have a
header. I move the column headings into the Master header (not page or
report headers). I set the Master Header band's RepeatSection to Yes.
Then I tell the printer how many columns there are and the column width.
Voila. Easy way to create column headings for each column in the report.
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: U N Me | last post by:
I have a continuous form that lists records from a query. One of the columns is an amount field, In the footer of the form I place a text box that displays the total (sum) of the amount. The...
6
by: Mike MacSween | last post by:
I have a report based on: PARAMETERS Forms!frmProductions!ProdID Long; SELECT Sum(qryRoleEvent.Fee) AS SumOfFee, First(qryMusician.LastName) AS LastName, First(qryMusician.FirstName) AS...
1
by: last Name | last post by:
Hello all, I'm using Access 2000. I have a subreport control which loads a report in the detail section of a main report. I need to keep a count of each item price in the subreport and place it...
1
by: Richard Hollenbeck | last post by:
How can I (if I can) display the sum of a text box values in the Detail in another text box in the page's footer? For example, I have a text box called "txtPoints" in the detail which displays...
6
by: DS | last post by:
How do you get a sumon a calculated field in a detail section on a report? I have a group footer that I need the sum on. Thanks DS
3
by: Pecanfan | last post by:
Hi, I've got an access report which contains a sub-report. The sub-report contains various items in a group Footer which culminates in a running sum text box called txtGrandTotal. I want to...
2
by: Ian Hinson | last post by:
Hi, In an MDB report I was able to obtain an Orders total in a Group Footer by setting a control's ControlSource to: =Sum(*) In the Detail section of the report are controls bound to: (1)...
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
2
by: apartain | last post by:
In the detail of my report I am extracting a sum from a hidden subform via the following: =IIf(.Report.HasData=True,.Report!Text19,0) Where Text19 is the sum of the items in the subform. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.