how can i use count(iif with >= 70 and <=109.99

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I am trying to create an expression that counts two criteria
Count(IIf([Currentreportwithregion]![Week1.98th_w/DOCSIS]>=70,IIf([Currentreportwithregion]![Week1.98th_w/DOCSIS]<=109.99),1,"")

any help would be appreciated
 
In
Dave said:
Hello,

I am trying to create an expression that counts two criteria
Count(IIf([Currentreportwithregion]![Week1.98th_w/DOCSIS]>=70,IIf([Currentreportwithregion]![Week1.98th_w/DOCSIS]<=109.99),1,"")

any help would be appreciated

Are you trying to get the number of records with [Week1.98th_w/DOCSIS]
between 70 and 109.99, inclusive? If so, you need to use a Sum
expression, not a Count:

Sum(IIf([Week1.98th_w/DOCSIS]>=70 And [Week1.98th_w/DOCSIS]<=109.99,
1, 0)

or (taking advantage of the fact that a logical "true" is represented
internally as -1):

Abs(Sum([Week1.98th_w/DOCSIS]>=70 And
[Week1.98th_w/DOCSIS]<=109.99))

Note that the above expressions will have been wrapped by the
newsreader, but each should actually be all on one line.
 
The count aggregate counts the number of rows with non-null values of its
argument. So use an expression which returns any non-null, maybe a 1, for
those rows you want to count and returns null for rows you don't want to
count.
 
I am using access 2003 and to answer Dirk yes I am trying to count the
inclusive between those ranges, much like a report card between 70 and 80
etc...

Jeff Boyce said:
Dave

Where?

Which version?

?!Access?!


--
More info, please ...

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

Dave said:
Hello,

I am trying to create an expression that counts two criteria
Count(IIf([Currentreportwithregion]![Week1.98th_w/DOCSIS]>=70,IIf([Currentre
portwithregion]![Week1.98th_w/DOCSIS]<=109.99),1,"")

any help would be appreciated
 
Thank you so much it appears to be working correctly I tried the abs option

Dirk Goldgar said:
In
Dave said:
Hello,

I am trying to create an expression that counts two criteria
Count(IIf([Currentreportwithregion]![Week1.98th_w/DOCSIS]>=70,IIf([Currentreportwithregion]![Week1.98th_w/DOCSIS]<=109.99),1,"")

any help would be appreciated

Are you trying to get the number of records with [Week1.98th_w/DOCSIS]
between 70 and 109.99, inclusive? If so, you need to use a Sum
expression, not a Count:

Sum(IIf([Week1.98th_w/DOCSIS]>=70 And [Week1.98th_w/DOCSIS]<=109.99,
1, 0)

or (taking advantage of the fact that a logical "true" is represented
internally as -1):

Abs(Sum([Week1.98th_w/DOCSIS]>=70 And
[Week1.98th_w/DOCSIS]<=109.99))

Note that the above expressions will have been wrapped by the
newsreader, but each should actually be all on one line.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top