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

Dcount in query not working

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 query I am trying the following:

NumOfYes:
Dcount([TimelyManner],"qryIndividualFeedbackDetail",[TimelyManner]=4)

The query is counting ALL of the timely manners and is ignoreing my
criteria.

Here is the select statement from the qryIndividualFeedbackDetail:

SELECT Format([DateEntered],"mmmm") & " " &
Format([DateEntered],"yyyy") AS MonYer,
[tblClientSurveys].[Representative],
[tblClientSurveyQuestions].[TimelyManner],
[tblClientSurveyQuestions].[HowKnowledgeable],
[tblClientSurveyQuestions].[AnswersClearandUnderstandable],
[tblClientSurveyQuestions].[CorrespondenceClearandUnderstandable],
[tblClientSurveyQuestions].[EasyToConductbusiness],
[tblClientSurveyQuestions].[RecommendBerkshire],
[tblClientSurveyQuestions].[CommmentsExpectations],
[tblClientSurveyQuestions].[ResponseExpected],
[tblClientSurveys].[PolicyNumber]
FROM tblClientSurveys INNER JOIN tblClientSurveyQuestions ON
[tblClientSurveys].[ClientSurveyID]=[tblClientSurveyQuestions].[ClientSurveyID];
Here is the select statement from the query in which I am trying to get
the Dcount to only total the TimelyManners=4:

SELECT qryIndividualFeedbackDetail.MonYer,
qryIndividualFeedbackDetail.Representative,
Avg(DAvg([CorrespondenceClearandUnderstandable],"qryIndividualFeedBackDetail",[CorrespondenceClearandUnderStandable]<>0))
AS [Avg Correspondence Rating],
Avg(DAvg([EasyToConductbusiness],"qryIndividualFeedbackDetail",[EasyToConductbusiness]<>0))
AS [Avg Ease Rating],
Avg(DAvg([HowKnowledgeable],"qryIndividualFeedbackDetail",[HowKnowledgeable]<>0))
AS [Avg Knowledge Rating],
Avg(DAvg([AnswersClearAndUnderstandable],"qryIndividualFeedbackDetail",[AnswersClearandUnderstandable]<>0))
AS [Avg Clarity Rating],
Count(DCount([TimelyManner],"qryIndividualFeedBackDetail",[TimelyManner]=4))
AS NumOfTimelyManner
FROM qryIndividualFeedbackDetail
GROUP BY qryIndividualFeedbackDetail.MonYer,
qryIndividualFeedbackDetail.Representative;

Nov 13 '05 #1
3 3293
One suggestion would be to make all three parameters of the DCount function
strings. For example:

NumOfYes:
Dcount("[TimelyManner]","qryIndividualFeedbackDetail","[TimelyManner]=4")
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"BerkshireGuy" <bd*****@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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 query I am trying the following:

NumOfYes:
Dcount([TimelyManner],"qryIndividualFeedbackDetail",[TimelyManner]=4)

The query is counting ALL of the timely manners and is ignoreing my
criteria.

Here is the select statement from the qryIndividualFeedbackDetail:

SELECT Format([DateEntered],"mmmm") & " " &
Format([DateEntered],"yyyy") AS MonYer,
[tblClientSurveys].[Representative],
[tblClientSurveyQuestions].[TimelyManner],
[tblClientSurveyQuestions].[HowKnowledgeable],
[tblClientSurveyQuestions].[AnswersClearandUnderstandable],
[tblClientSurveyQuestions].[CorrespondenceClearandUnderstandable],
[tblClientSurveyQuestions].[EasyToConductbusiness],
[tblClientSurveyQuestions].[RecommendBerkshire],
[tblClientSurveyQuestions].[CommmentsExpectations],
[tblClientSurveyQuestions].[ResponseExpected],
[tblClientSurveys].[PolicyNumber]
FROM tblClientSurveys INNER JOIN tblClientSurveyQuestions ON
[tblClientSurveys].[ClientSurveyID]=[tblClientSurveyQuestions].[ClientSurveyID];
Here is the select statement from the query in which I am trying to get
the Dcount to only total the TimelyManners=4:

SELECT qryIndividualFeedbackDetail.MonYer,
qryIndividualFeedbackDetail.Representative,
Avg(DAvg([CorrespondenceClearandUnderstandable],"qryIndividualFeedBackDetail",[CorrespondenceClearandUnderStandable]<>0))
AS [Avg Correspondence Rating],
Avg(DAvg([EasyToConductbusiness],"qryIndividualFeedbackDetail",[EasyToConductbusiness]<>0))
AS [Avg Ease Rating],
Avg(DAvg([HowKnowledgeable],"qryIndividualFeedbackDetail",[HowKnowledgeable]<>0))
AS [Avg Knowledge Rating],
Avg(DAvg([AnswersClearAndUnderstandable],"qryIndividualFeedbackDetail",[AnswersClearandUnderstandable]<>0))
AS [Avg Clarity Rating],
Count(DCount([TimelyManner],"qryIndividualFeedBackDetail",[TimelyManner]=4))
AS NumOfTimelyManner
FROM qryIndividualFeedbackDetail
GROUP BY qryIndividualFeedbackDetail.MonYer,
qryIndividualFeedbackDetail.Representative;
Nov 13 '05 #2
Unfortunately that did not work. Still returning 2, and it should only
be 1 since there is only one 4.

Thanks

-Brian

Nov 13 '05 #3
Maybe you can give me some additional information about the following line
in the second query:

Count(DCount([TimelyManner],"qryIndividualFeedBackDetail",[TimelyManner]=4))

If you are trying to count "the number of records from
qryIndividualFeedbackDetail where the
TimelyManner field is set to 4" then just the DCount function without the
outer Count function would seem to return the value you desire. Maybe there
are some additional considerations here that I do not understand.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"BerkshireGuy" <bd*****@yahoo.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Unfortunately that did not work. Still returning 2, and it should only
be 1 since there is only one 4.

Thanks

-Brian
Nov 13 '05 #4

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

Similar topics

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...
15
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting...
2
by: ChasW | last post by:
Greetings, I have a form that uses a query as its record source. In the form I have a text box that uses this as its control source: =DCount("", "qry_Search_by_Name") The DCount function...
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...
1
by: weety | last post by:
Hi =DCount("*","qryBc003_2_Xstats") The above syntax which was working for old tables is not working for new tables or queries , I have updated the changes the new query is working fine with...
7
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...
3
by: ringer | last post by:
I am trying to add a functionality into a db I use for my checkbook that will help me plan for and save money for future large expenses. Into a table called tblFutureTransactions I want to enter...
36
by: bmyers | last post by:
Good afternoon, I am attempting to count only those records within a report, which is based on a query, where Status is equal to Closed. I have tried multiple variations of DCOUNT but am...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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.