Hi Everybody-
I've been reading some of the posts about DCOUNT, and I haven't yet
found an answer; so, I'm posting this question.
I have a report that I'm trying to use DCOUNT on to compute the
percentages of each group. The groups are based on sports. For
instance, football, soccer, baseball, basketball. I have a table of
people that play these sports.
My report groups the sports people play. For example, my report may
look like this:
GROUP Header 1
Basketball:
Michael Jordan
Kobe Bryant
GROUP Footer 1
Total: 2 (Using the simple Count(*) in the Group
Footer)
GROUP Header 2
Soccer:
David Beckham
GROUP Footer 2
Total: 1
REPORT Footer
Grand Total: 3 (I'm using Count(*) again here)
Then in the Footer of my report, I use the Count(*) function again to
compute the total number of records. Then, I use the DCOUNT function
to compute the percentages of people that play each sport.
=DCount("[Sport]","qrySports","[Sport] = 'Basketball'")/Count(*)
So, for "basketball," I would get: 2/3 = .667
HOWEVER...when I try to use a Date Parameter as a criteria in my
query, I get an error (#ERROR).
In the criteria for my "Date" field, I'm using: Between [Beginning
Date] And [Ending Date].
I've read a few posts where some people have tried a few different
things, such as creating multiple queries or creating a form to use.
So, I guess my question is: Will DCOUNT work if I add extra code to
it?
For example:
=DCount("[Sport]","qrySports","[Sport] = 'Basketball'")/Count(*) And
Queries!qrySports![Enter Beginning Date] & " to " &
Queries!qrySports[Enter Ending Date]
OR is there a better way to accomplish this?
Thanks everybody!
Megan 1 2786
Megan wrote: Hi Everybody-
I've been reading some of the posts about DCOUNT, and I haven't yet found an answer; so, I'm posting this question.
I have a report that I'm trying to use DCOUNT on to compute the percentages of each group. The groups are based on sports. For instance, football, soccer, baseball, basketball. I have a table of people that play these sports.
My report groups the sports people play. For example, my report may look like this: GROUP Header 1
Basketball: Michael Jordan Kobe Bryant
GROUP Footer 1 Total: 2 (Using the simple Count(*) in the Group Footer)
GROUP Header 2
Soccer: David Beckham
GROUP Footer 2 Total: 1
REPORT Footer
Grand Total: 3 (I'm using Count(*) again here) Then in the Footer of my report, I use the Count(*) function again to compute the total number of records. Then, I use the DCOUNT function to compute the percentages of people that play each sport.
=DCount("[Sport]","qrySports","[Sport] = 'Basketball'")/Count(*)
So, for "basketball," I would get: 2/3 = .667
HOWEVER...when I try to use a Date Parameter as a criteria in my query, I get an error (#ERROR).
In the criteria for my "Date" field, I'm using: Between [Beginning Date] And [Ending Date].
I've read a few posts where some people have tried a few different things, such as creating multiple queries or creating a form to use.
So, I guess my question is: Will DCOUNT work if I add extra code to it?
For example:
=DCount("[Sport]","qrySports","[Sport] = 'Basketball'")/Count(*) And Queries!qrySports![Enter Beginning Date] & " to " & Queries!qrySports[Enter Ending Date]
OR is there a better way to accomplish this?
Thanks everybody!
Megan
I don't know if this will work.
Instead of /Count(*), use the name of the text field that contains the
count.
=DCount("[Sport]","qrySports","[Sport] = 'Basketball'")/[FooterCountField] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: jdph40 |
last post by:
I posted this problem previously and received excellent help from
Wayne Morgan. However, I still have an unanswered question. My form
(frmVacationWeeks) is opened from the OnClick event of a...
|
by: Will |
last post by:
Hi, I had a DCount within a module on records in a table where CustSuffix =
0. I now need to DCount where CustSuffix = 0 and the type of cost Suffix
(Suffix in table) = G. I can't get both...
|
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...
|
by: Paul T. RONG |
last post by:
Hi,
I have a problem with DCount, the following code doesn't work:
DCount("", "qryOrder", "( = Me! AND
= 'drink')" > 0
Please help.
Thank you.
|
by: BerkshireGuy |
last post by:
I am having difficulty with using the Dcount function. I am trying to
return the number of records from qryIndividualFeedbackDetail where the
TimelyManner field is set to 4.
So, in the new...
|
by: MLH |
last post by:
Suppose I have this simple SQL string...
SELECT tblDrivers.DriverID, tblDrivers.DName
FROM tblDrivers
WHERE (((tblDrivers.DName) Like "N*"))
ORDER BY tblDrivers.DriverID;
And suppose that...
|
by: Wingz |
last post by:
Hiya,
Fairly new to Access and was wondering what the best way to perform Dcounts on groups in an Access report.
For example, I have 10 employees and the different instances of jobs they can...
|
by: Michael R |
last post by:
Good afternoon. I'm stucked in composing the syntax for DCount expression in a select query. The query qryCustomers has CustomerID field, the DCount function uses tblLoans with LoanDate and Id fields...
|
by: davidwelli |
last post by:
Hello,
All help is appreciated, I'm struggling with the following.
Using Access 2003 (front end) connecting to Oracle 7 database (back end). I'm trying to create a query in access that will...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |