PC Review


Reply
Thread Tools Rate Thread

DCount with one single condition works, but several ones, joined together with the logical operator AND, do not!

 
 
Henrik Jansson
Guest
Posts: n/a
 
      9th Feb 2010
Dear friends out there,

I simply do not understand this. What's wrong with the syntax in my
Access-2007 report?

=DCount("[ID]", "Table", "[ConditionYesNo1] = No") -----> returns a correct
minor total of all records with no checkmarks in the field (column)
"ConditionYesNo1".

=DCount("[ID]", "Table", "[ConditionYesNo1] = No" AND "[ConditionYesNo2] =
No" ) -----> returns ALL records. Why i that?

Thanks in advance

Henrik


__________ Information från ESET NOD32 Antivirus, version av virussignaturdatabas 4848 (20100208) __________

Meddelandet har kontrollerats av ESET NOD32 Antivirus.

http://www.esetscandinavia.com



 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      9th Feb 2010
Try the following correctly formatted argument.

=DCount("[ID]", "Table", "[ConditionYesNo1] = No AND [ConditionYesNo2] = No" )


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Henrik Jansson wrote:
> Dear friends out there,
>
> I simply do not understand this. What's wrong with the syntax in my
> Access-2007 report?
>
> =DCount("[ID]", "Table", "[ConditionYesNo1] = No") -----> returns a
> correct minor total of all records with no checkmarks in the field
> (column) "ConditionYesNo1".
>
> =DCount("[ID]", "Table", "[ConditionYesNo1] = No" AND "[ConditionYesNo2]
> = No" ) -----> returns ALL records. Why i that?
>
> Thanks in advance
>
> Henrik
>
> __________ Information från ESET NOD32 Antivirus, version av
> virussignaturdatabas 4848 (20100208) __________
>
> Meddelandet har kontrollerats av ESET NOD32 Antivirus.
>
> http://www.esetscandinavia.com
>
>
>

 
Reply With Quote
 
Duane Hookom
Guest
Posts: n/a
 
      9th Feb 2010
You made it more complex than required:

=DCount("[ID]", "Table", "[ConditionYesNo1] = 0 AND [ConditionYesNo2] = 0" )

You could also try
=DCount("[ID]", "Table", "[ConditionYesNo1] + [ConditionYesNo2] = 0" )

--
Duane Hookom
Microsoft Access MVP


"Henrik Jansson" wrote:

> Dear friends out there,
>
> I simply do not understand this. What's wrong with the syntax in my
> Access-2007 report?
>
> =DCount("[ID]", "Table", "[ConditionYesNo1] = No") -----> returns a correct
> minor total of all records with no checkmarks in the field (column)
> "ConditionYesNo1".
>
> =DCount("[ID]", "Table", "[ConditionYesNo1] = No" AND "[ConditionYesNo2] =
> No" ) -----> returns ALL records. Why i that?
>
> Thanks in advance
>
> Henrik
>
>
> __________ Information från ESET NOD32 Antivirus, version av virussignaturdatabas 4848 (20100208) __________
>
> Meddelandet har kontrollerats av ESET NOD32 Antivirus.
>
> http://www.esetscandinavia.com
>
>
>
> .
>

 
Reply With Quote
 
Henrik Jansson
Guest
Posts: n/a
 
      9th Feb 2010
Thank you so much John! That solved my problem.

Best regards,

Henrik

"John Spencer" <(E-Mail Removed)> skrev i meddelandet
news:(E-Mail Removed)...
> Try the following correctly formatted argument.
>
> =DCount("[ID]", "Table", "[ConditionYesNo1] = No AND [ConditionYesNo2] =
> No" )
>
>
> John Spencer
> Access MVP 2002-2005, 2007-2010
> The Hilltop Institute
> University of Maryland Baltimore County
>
> Henrik Jansson wrote:
>> Dear friends out there,
>>
>> I simply do not understand this. What's wrong with the syntax in my
>> Access-2007 report?
>>
>> =DCount("[ID]", "Table", "[ConditionYesNo1] = No") -----> returns a
>> correct minor total of all records with no checkmarks in the field
>> (column) "ConditionYesNo1".
>>
>> =DCount("[ID]", "Table", "[ConditionYesNo1] = No" AND "[ConditionYesNo2]
>> = No" ) -----> returns ALL records. Why i that?
>>
>> Thanks in advance
>>
>> Henrik
>>
>> __________ Information från ESET NOD32 Antivirus, version av
>> virussignaturdatabas 4848 (20100208) __________
>>
>> Meddelandet har kontrollerats av ESET NOD32 Antivirus.
>>
>> http://www.esetscandinavia.com
>>
>>
>>

>
> __________ Information från ESET NOD32 Antivirus, version av
> virussignaturdatabas 4848 (20100208) __________
>
> Meddelandet har kontrollerats av ESET NOD32 Antivirus.
>
> http://www.esetscandinavia.com
>
>
>



__________ Information från ESET NOD32 Antivirus, version av virussignaturdatabas 4848 (20100208) __________

Meddelandet har kontrollerats av ESET NOD32 Antivirus.

http://www.esetscandinavia.com



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with logical operator ThunderMusic Microsoft Dot NET 2 19th Jan 2006 03:10 PM
Help with logical operator =?Utf-8?B?QWxwaGE=?= Microsoft C# .NET 2 7th Sep 2005 07:16 PM
logical operator Microsoft C# .NET 1 12th May 2005 11:29 AM
Logical Operator <= and >= Ron Microsoft Excel Worksheet Functions 1 10th Oct 2003 04:09 PM
AND logical operator Catherine Brown Microsoft Excel Worksheet Functions 5 26th Aug 2003 06:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 AM.