A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem with Count



 
 
Thread Tools Display Modes
  #1  
Old May 21st, 2004, 01:15 PM
Leslie Isaacs
external usenet poster
 
Posts: n/a
Default Problem with Count

Hello All

I have a report based on a query that includes the two fields [payreference]
and [payamount].

There will normally be more than one record with the same [payreference].

The report does not need to display the individual records, only the total
of [payamount] for each value of [payreference], so I have a [payamount]
section footer containing the field =Sum([payamount]). Each value of
Sum([payamount]) is a payment to be made. The detail section of the report
is empty, and of zero height.

My problem is that the report also needs to display the total number of
payments to be made in the report footer, but if I put a field with
=Count(payreference]) I get the total number of records. e.g.

query output:
payreference payamount
abc £1234
abc £123
def £423
def £55
def £141
ghi £333

The count field in the report footer need to display the value 3, because 3
payments will be made (1 for each [payreference]), but Count(payreference])
returns a value of 6 (because of course there are 6 records underlying the 3
payments).

I cannot see how to get at the count of the number of payments, and would be
very grateful if someone could help.

Many thanks
Leslie Isaacs


  #2  
Old May 21st, 2004, 01:25 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Problem with Count

Considering the information that you have provided, I would base the report
on a totals query that groups by PayReference and Sums PayAmount. Then place
the results in the detail section rather than a footer.

If you can't do this, then add a text box to the Group Header
Name: txtCountPayRef
Control Source: =1
Running Sum: Over All

The add a text box to the report footer
Control Source: =txtCountPayRef

--
Duane Hookom
MS Access MVP


"Leslie Isaacs" wrote in message
...
Hello All

I have a report based on a query that includes the two fields

[payreference]
and [payamount].

There will normally be more than one record with the same [payreference].

The report does not need to display the individual records, only the total
of [payamount] for each value of [payreference], so I have a [payamount]
section footer containing the field =Sum([payamount]). Each value of
Sum([payamount]) is a payment to be made. The detail section of the report
is empty, and of zero height.

My problem is that the report also needs to display the total number of
payments to be made in the report footer, but if I put a field with
=Count(payreference]) I get the total number of records. e.g.

query output:
payreference payamount
abc £1234
abc £123
def £423
def £55
def £141
ghi £333

The count field in the report footer need to display the value 3, because

3
payments will be made (1 for each [payreference]), but

Count(payreference])
returns a value of 6 (because of course there are 6 records underlying the

3
payments).

I cannot see how to get at the count of the number of payments, and would

be
very grateful if someone could help.

Many thanks
Leslie Isaacs




  #3  
Old May 24th, 2004, 11:13 AM
Leslie Isaacs
external usenet poster
 
Posts: n/a
Default Problem with Count

Thanks Duane - your suggestion worked a treat!
Les



"Duane Hookom" wrote in message
...
Considering the information that you have provided, I would base the

report
on a totals query that groups by PayReference and Sums PayAmount. Then

place
the results in the detail section rather than a footer.

If you can't do this, then add a text box to the Group Header
Name: txtCountPayRef
Control Source: =1
Running Sum: Over All

The add a text box to the report footer
Control Source: =txtCountPayRef

--
Duane Hookom
MS Access MVP


"Leslie Isaacs" wrote in message
...
Hello All

I have a report based on a query that includes the two fields

[payreference]
and [payamount].

There will normally be more than one record with the same

[payreference].

The report does not need to display the individual records, only the

total
of [payamount] for each value of [payreference], so I have a [payamount]
section footer containing the field =Sum([payamount]). Each value of
Sum([payamount]) is a payment to be made. The detail section of the

report
is empty, and of zero height.

My problem is that the report also needs to display the total number of
payments to be made in the report footer, but if I put a field with
=Count(payreference]) I get the total number of records. e.g.

query output:
payreference payamount
abc £1234
abc £123
def £423
def £55
def £141
ghi £333

The count field in the report footer need to display the value 3,

because
3
payments will be made (1 for each [payreference]), but

Count(payreference])
returns a value of 6 (because of course there are 6 records underlying

the
3
payments).

I cannot see how to get at the count of the number of payments, and

would
be
very grateful if someone could help.

Many thanks
Leslie Isaacs






 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.