473,387 Members | 1,510 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.

Counting certain rows from a query

Im helping a friend with a little access and we're both stuck on this one part. Hes using a query to create a report and he wanted to add a total of certain rows in teh header or footer. We know how to use the =Count(*) in the textbox to get the total rows returned form the Query,but is there a way to filter them?

He has a feild that is called Status and would contain either the word "Allocated" or "Unallocated". He would like to count how many of each. Do we still use the =Count() but have a filter within it?
Mar 28 '07 #1
7 1522
Rabbit
12,516 Expert Mod 8TB
Group by Status.
Mar 28 '07 #2
Thanks for the answer, i tried to enter it but it doesnt seem to work.Again im not really advanced in access at all. Where would i put this?
Mar 28 '07 #3
Rabbit
12,516 Expert Mod 8TB
View > Totals.

And in the Totals section there should be a drop down box, select Group By for status.
Mar 28 '07 #4
I dont think i explained myself well enough... Ill try again,

We are calling a query that will return lets say about 60 results. From the results from the query, there is a feild called Status which can be either "Allocated" or "Unallocated". What we are trying to do is count the amount of times they both appear in the query result and display the number of each in their own text box on the report form.
Mar 29 '07 #5
Rabbit
12,516 Expert Mod 8TB
Is the report grouped by Status? You can have the count in either the group header or footer and it'll only count the ones in that group.

If not, or you don't want your report that way, use
Expand|Select|Wrap|Line Numbers
  1. DCount("*", "[Table Name]", "Status = 'Allocated'")
Mar 29 '07 #6
This worked perfect, all i did instead of using the [Table Name] is replaced it with the Query name and it worked like a charm. Thanks Rabbit

Expand|Select|Wrap|Line Numbers
  1. DCount("*", "[Table Name]", "Status = 'Allocated'")
Apr 2 '07 #7
Rabbit
12,516 Expert Mod 8TB
Not a problem.
Apr 2 '07 #8

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

Similar topics

2
by: Reply via newsgroup | last post by:
Folks, When performing an update in mysql (using PHP), can I find out how many records were matched? mysql_affected_rows() won't work... and I have the following problem that I thought I...
20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
0
by: Perttu Pulkkinen | last post by:
We have many kinds of advertisers in our web service: 1.private 2. companies, of which some are members of local enterpreneur community 3. non-profitable communities Company advertisers can...
3
by: Mike | last post by:
I have a view that will return say 5000 records when I do a simple select query on that view like. select * from vw_test_view How can I set up my query to only return a certain # of...
2
by: Adam | last post by:
In my MYISAM table I have an index (Index_A) on 2 fields (Field_A, Field_B). There are millions of rows in the table. The cardinality of Index_A is 53. I think a query to count the number of rows...
2
by: Glenn Cornish | last post by:
I have 5 fields in a table into which numbers between 1 and 45 can be entered. What I am having trouble with is being able to find out is how many times a particular number appears, regardless of...
3
by: Peter | last post by:
Hi, This post is about counting rows and finding the max count in a group of rows. I'm trying to find the player who scored the most goals in a game. I know how to find out how many goals the...
18
by: ChadDiesel | last post by:
I appreciate the help on this group. I know I've posted a lot here the last couple of weeks, but I was thrown into a database project at my work with very little Access experience. No other...
3
by: chribben | last post by:
Hi, I have the following query: 1. SELECT products.name, COUNT(reviews.review) 2. FROM (select distinct name from products) products 3. FULL JOIN reviews ON products.name =...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...

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.