473,508 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Count Function

3 New Member
I have generated a number of queries successfully. However, I would in my subsequent reports like to get a count of each field which has data in it (that is, "is not null").

But I am confused by the Access Help instructions regarding the "Count Function". I tried to use the Expression Builder, but keep getting a syntax error message. Is there a simple way to do a count function for each of the fields in the query or report?

Thanks,
Brian P
Aug 29 '06 #1
4 3402
sanniep
48 New Member
Hey Brian,

Do you mean you want 1 report to display fields with a number of records from different queries? If so use the DCount function in your report's textboxes. Function: DCount("[Employeenumber]";"[Qry_Employees]";"[Employee]='John Doe'"). (Mind the placement of single/double quotations). You can also use DSum, DMax, etc.

Reply if I don't get it.. Grtz, Sander
Aug 29 '06 #2
Brian P
3 New Member
Sander,

Not exactly. Suppose I have 5 Fields (Name, Green, Yellow, Blue, Red) and 20 Records. What I want my report to do is provide a count of how many records are in each field (not null). So that at the bottom of the report it would total how many records contain an entry in that field. Like so....

Name Green Yellow Blue Red
20 11 7 4 12

I would have thought this to be simple, even having a preprogrammed text box for it.

How would you do this?

Brian
Aug 29 '06 #3
sanniep
48 New Member
Well, it should be simple! There are a couple of ways:
1. Make a query (in Access interface), add the table and the fields to count. Use the totals button in your taskbar and set al your Totals to Count. The query result should give you the desired result. Take your report and add a subreport at the bottom based on the query we've just made. Customize the layout and it should be what you want.
2. Make 5 textboxes in your reportand fill them with =Count([Name]), = Count([Green]), etc.

What do you think? Sander
Aug 29 '06 #4
Brian P
3 New Member
Sander,

After I have entered the info, I keep getting a box asking to "Enter parameter value". What parameter value? I don't understand.

Brian
Aug 29 '06 #5

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

Similar topics

9
10807
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
3
4576
by: jason | last post by:
Hello. I've got this simple collection populate code I downloaded from the net (sorry can't find source now) I'm trying to test, but I can't seem to get it to work. Any help would be greatly...
10
2861
by: Jon | last post by:
I want to count the number of instances of a certain string(delimiter) in another string. I didn't see a function to do this in the framework (if there is, please point me to it). If not, could...
3
26208
by: Kuups | last post by:
Hi! I have a question regarding the count if character within a string like for example I have a string of e.g. 123#123# I would like to determine what is the code? of getting the # sign
68
6747
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
23
2860
by: Gary Wessle | last post by:
Hi I have a vector<charwhich looks like this (a d d d a d s g e d d d d d k) I need to get the biggest count of consecutive 'd'. 5 in this example I am toying with this method but not sure if...
2
3785
by: Volkan | last post by:
Hi, I'm trying to compare two XML documents and i'm using XPath queries to select nodes. XPathNavigator's Select method runs fast enough and returns an XPathNodeIterator object. When i try to...
2
2579
by: DrewKull | last post by:
Ok ... so I'm looking at a query where im trying to show a bunch of columns counted up based on criteria ... So far i've been able to count all the rows up and show them ... and also count up...
22
12425
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
26
2425
by: Ping | last post by:
Hi, I'm wondering if it is useful to extend the count() method of a list to accept a callable object? What it does should be quite intuitive: count the number of items that the callable returns...
0
7224
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
7323
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
7379
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
7038
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
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3192
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
1550
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 ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.