473,396 Members | 2,013 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.

subtracting or exempting in a Dcount

hey, i'm writting a database and in my report am tryin to have dcounts count some diffrent fields
i would like to know if there is a way to have your dcount skip or not count a field or if there is a way to subtract in dcount

Expand|Select|Wrap|Line Numbers
  1. =DCount("*","[sort from combo]","CPU = 'P4' and (Type = 'Desktop' or Type = 'Tower')")
now this line is also counting a field in my Table that i would like it to ignore,

Status="Recycle" is what i'm tryin to get this dcount to skip...
so i was wondering if there was a way for it not to count rows that have Recycle in it or if there was a way to subtract them at then end so that the final number is not count the recycle fields
Jul 31 '07 #1
4 1429
Rabbit
12,516 Expert Mod 8TB
DCount doesn't count fields, it counts records if you specify "*" or it counts any non-null value if you specify a field. Since you specified "*" it will just count records, no fields involved.
Jul 31 '07 #2
JKing
1,206 Expert 1GB
hey, i'm writting a database and in my report am tryin to have dcounts count some diffrent fields
i would like to know if there is a way to have your dcount skip or not count a field or if there is a way to subtract in dcount

=DCount("*","[sort from combo]","CPU = 'P4' and (Type = 'Desktop' or Type = 'Tower')")

now this line is also counting a field in my Table that i would like it to ignore,

Status="Recycle" is what i'm tryin to get this dcount to skip...
so i was wondering if there was a way for it not to count rows that have Recycle in it or if there was a way to subtract them at then end so that the final number is not count the recycle fields
I think you may just be missing using the term field and in that case I think what you're looking for is narrowing it down to where computers have P4s are desktops or towers and the status is not recycle.

Expand|Select|Wrap|Line Numbers
  1. =DCount("*","[sort from combo]","CPU = 'P4' and (Type = 'Desktop' or Type = 'Tower') AND Status <> 'Recycle'")
  2.  
Jul 31 '07 #3
I think you may just be missing using the term field and in that case I think what you're looking for is narrowing it down to where computers have P4s are desktops or towers and the status is not recycle.

Expand|Select|Wrap|Line Numbers
  1. =DCount("*","[sort from combo]","CPU = 'P4' and (Type = 'Desktop' or Type = 'Tower') AND Status <> 'Recycle'")
  2.  

yeah thats xacly what i was looking for, i did figure it out but thank you very much for the help =D

Expand|Select|Wrap|Line Numbers
  1. =DCount("*","[sort from combo]","CPU = 'P4' and Status <> 'Recycle' and (Type = 'Desktop' or Type = 'Tower') ")
Jul 31 '07 #4
NeoPa
32,556 Expert Mod 16PB
yeah thats xacly what i was looking for, i did figure it out but thank you very much for the help =D

Expand|Select|Wrap|Line Numbers
  1. =DCount("*","[sort from combo]","CPU = 'P4' and Status <> 'Recycle' and (Type = 'Desktop' or Type = 'Tower') ")
When a list is longer than two items, it's generally better to use In(). If you'd needed to include laptops as well for instance, you could have :
Expand|Select|Wrap|Line Numbers
  1. =DCount("*","[sort from combo]","CPU='P4' AND [Status]<>'Recycle' AND [Type] In('Desktop','Tower','Laptop')")
Jul 31 '07 #5

Sign in to post your reply or Sign up for a free account.

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...
1
by: Megan | last post by:
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...
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...
2
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.
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: 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...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...

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.