By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,910 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

Question on Dcount -

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.