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

Question on Dcount -

I am running the following query and getting the "you tried to execute
an query that does not include the specified expression as part of the
aggregate function:

SELECT
DCount([HowKnowledgeable],"qryIndividualFeedbackDetail",[HowKnowledgeable]<>0)
AS [Count Of NonZero Knowledgeables],
qryIndividualFeedbackDetail.Representative
FROM qryIndividualFeedbackDetail
GROUP BY qryIndividualFeedbackDetail.RepresentativeTeam,
qryIndividualFeedbackDetail.Representative;

I am trying to count the number of records not equal to 0 in the
HowKnowledgable column. I cant user <>0 in the criteria because other
columns (i.e. HowHelpful) may have numbers besides 0.

Thanks
Brian

Nov 13 '05 #1
1 1895
BerkshireGuy wrote:
I am running the following query and getting the "you tried to execute
an query that does not include the specified expression as part of the
aggregate function:

SELECT
DCount([HowKnowledgeable],"qryIndividualFeedbackDetail",[HowKnowledgeable]<>0)
AS [Count Of NonZero Knowledgeables],
qryIndividualFeedbackDetail.Representative
FROM qryIndividualFeedbackDetail
GROUP BY qryIndividualFeedbackDetail.RepresentativeTeam,
qryIndividualFeedbackDetail.Representative;

I am trying to count the number of records not equal to 0 in the
HowKnowledgable column. I cant user <>0 in the criteria because other
columns (i.e. HowHelpful) may have numbers besides 0.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try this query:

SELECT Q.RepresentativeTeam, Q.Representative,
Count(IIf([HowKnowledgeable]<>0,1) AS [Count Of NonZero Knowledgeables],
FROM qryIndividualFeedbackDetail As Q
GROUP BY Q.RepresentativeTeam, Q.Representative

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQtKskoechKqOuFEgEQILagCg2nHgg8XTO+dx0XsaHbP4Qs kIppIAmQGs
JkarAEYIQSy7IIEgae9u7IIF
=uuVR
-----END PGP SIGNATURE-----
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
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...
5
by: Richard Holliingsworth | last post by:
Hello: Thanks for reading this post. I need to create a metrics (form or report - I don't care which) to display calculated fields about the database (A2002 front end to SQL Server 2K) 1) I...
11
by: NC Tim | last post by:
Hello, I think the question i have is fairly straightforward, but I can't seem to replicate the old SAS frequency procedure when I try to accomplish this in MS Access. anyway, i have about 10...
1
by: Chris M. | last post by:
I'm trying to pull the top two people in multiple locations using DCOUNT. If there is a tie for 2nd, my query only shows one person. Table: tblSales-Location, EEID, Units, etc... Query:...
4
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...
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...
3
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...
2
by: Kaspa | last post by:
Hello I am trying to create dcount field but is not working I have tried every way possible and I can't get it to work. here is my code: =Dcount("","qryTotalscratched"," in (6,7,8,9) and ...
2
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...
8
by: Susan Bricker | last post by:
I have used DCount() to determine the number of records in a recordset. Silly me ... I just noticed that DCount returns an INTEGER, which can hold a maximum value of 32,767. What if the recordset...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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
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...

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.