473,326 Members | 2,108 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,326 software developers and data experts.

Count Function

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 3396
sanniep
48
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
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
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
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
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
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
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
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
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
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
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.