473,466 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Count in Report

26 New Member
I am building a report that has a Providers header, Language header, and Type header grouped on each other. So when it prints out, it states each Name, then every language associated with the person, and for each language if they interpreted or translated.

I already know how to do the regular count function for each header. What I am trying to figure out is if I can do a sort of DCount or not. The Provider/Name header just counts all records for that name and I need to try to split that count into two sections, one where it shows how many times the person did something for themselves and how many they did it for someone else. I don't know if I will be able to do it or not since it is in a header area.

Example:
John Smith has a total of 10 records he spoke spanish to someone. 7 of those records he spoke spanish with his own client. 3 of those records he spoke spanish to someone else's client.

In my query that I run the report off of, I have 2 fields, A (which is not on the report) and B (which is the Providers/Name header). I would like to try to count so that for each person under Name header if A=B it means his own client and if A =/= B then it means someone else's client.

I hope this doesn't confuse anyone too much. Below is what my report looks like now and in bold italics is what I want to add.

Expand|Select|Wrap|Line Numbers
  1. John Smith 10  Own Clients 7  Others Clients 3
  2.      Spanish 5
  3.           Interpretation 5
  4.      French  5
  5.           Interpretation 3
  6.           Translation    2
  7. Jane Doe  20   Own Clients 20  Others Clients 0
  8.      German 20
  9.           Interpretation 15
  10.           Translation    5 
Thanks!
Sep 22 '14 #1

✓ answered by twinnyfo

Elaine,

In the query that you build for your report, include that very same language for two new fields:

Expand|Select|Wrap|Line Numbers
  1. OwnClient: IIf(A=B,1,0)
  2. OtherClient:  IIf(A<>B,1,0)
Then, in your Header, add two Text Box Controls:

txtOwnClient, which has the Control Source:

Expand|Select|Wrap|Line Numbers
  1. =Sum([OwnClient])
and txtOtherClient, which has the Control Source:

Expand|Select|Wrap|Line Numbers
  1. =Sum([OtherClient])
Hope this makes sense.

5 940
twinnyfo
3,653 Recognized Expert Moderator Specialist
Elaine,

In the query that you build for your report, include that very same language for two new fields:

Expand|Select|Wrap|Line Numbers
  1. OwnClient: IIf(A=B,1,0)
  2. OtherClient:  IIf(A<>B,1,0)
Then, in your Header, add two Text Box Controls:

txtOwnClient, which has the Control Source:

Expand|Select|Wrap|Line Numbers
  1. =Sum([OwnClient])
and txtOtherClient, which has the Control Source:

Expand|Select|Wrap|Line Numbers
  1. =Sum([OtherClient])
Hope this makes sense.
Sep 22 '14 #2
MysticElaine
26 New Member
Thanks for the response! I tried to add the 2 new fields, hope I did it right...it comes up Exp1: [ownclients] and Exp2: [otherclients]. However, when I go to run the report, it asks me to enter the parameters for the two fields, which can't be left blank. Any ideas? Thanks!
Sep 23 '14 #3
jforbes
1,107 Recognized Expert Top Contributor
MysticElaine,
Twinnyfo's recommendation is asking you to create two Columns in your Query with the following as their Source (in Field: in the Query By Example Editor): "OwnClient: IIf(A=B,1,0)" and "OtherClient: IIf(A<>B,1,0)" instead of "Exp1: [ownclients]" and "Exp2: [otherclients]"

The error message you are getting is from Access failing to resolve [ownclients] and [otherclients] to then stuff them into the Fields Exp1 and Exp2. When the Query runs and Access doesn't know what they are, it asks the user, so you probably got a couple dialog boxes that you Cancled out of, then Access really didn't know what to do with it, so it gave you the Error.

Let us know how it works.
Sep 23 '14 #4
MysticElaine
26 New Member
Perfect! Thanks!!!!!
Sep 23 '14 #5
twinnyfo
3,653 Recognized Expert Moderator Specialist
@jforbes,

Thanks for explaining more better than I did!

Peace!
Sep 23 '14 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Petterson Mikael | last post by:
How can I count all java packages that contains fpx in their name using xslt? cheers, //mikael I have the following data: <report>
0
by: bill mahoney | last post by:
I have access 2k and I have 2 tables. One is a 7X6 table representing a month with zeroes padding the fields where no day exist. For example February 2003 0 0 0 0 0 0 1 2 3 4 5 6 7 ...
6
by: Richard Holliingsworth | last post by:
Hello: Thanks for reading this. I would like to build a report (Access 2002) that uses SQL queries to count records in specific groups. I've tried several methods and so far no luck. ...
5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
1
by: Justin Koivisto | last post by:
I am trying to create a report that displays a name of an advertising source and count of the number of times it was hit between certain date ranges. The data is split between two different...
5
by: Cro | last post by:
Hello Access Developers, I'd like to know if it is possible to perform a count in an expression that defines a control source. My report is based on a query. In my report, I want a text box to...
1
by: VBSponge | last post by:
Hi all. In A2K i have a report with a control bound to to calculate the page count for the report. I need to retrieve this page count from the report, and build it into a TOC containing this an...
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
1
by: N06149 | last post by:
I have a report based on a query. I list an Org_Type then Org_Name then the Projects associated with it. Sample of report below: Community Type...
2
mose Mbugua
by: mose Mbugua | last post by:
I have made a report from a query and added a sub report created from a different query. The main query has a calculated field so is the sub report. i want to subtract the totals in the sub report...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.