Count in a range

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

Guest

I have a field name 'pending'. The field consist number from 0 to any number.
In my report i want to count number of account with different range of
'pending' number.

Say pending from 1 to 2, or
3 to 6 or
above 7.

I tried to use this =Abs(Sum([pending]>1<2)) for the 1st defn but it won't
work.

Thanks
 
Try:
=Abs(Sum([pending] Between 1 AND 2))

You would be better off if you create a table of min and max values with a
field for range title. You could add this to your report's record source and
set the criteria under the Pending field to
Between MinRange And MaxRange
Add the range title to the report so you could summarize your records by
range using data rather than hard-coded values.
 
DCount("*","TblAccounts","[Pending] >=1 And [Pending] <=2")

DCount("*","TblAccounts","[Pending] >=3 And [Pending] <=6")

DCount("*","TblAccounts","[Pending] >7")
 
DCount() is very inefficient since it re-queries the data. Using the Sum(
Abs(Expression) ) uses the records already queried in the report's record
source.

Also, if you open the report with a where clause, the DCount() will still
reference the entire table while the report includes only filtered records.
This usually isn't what the report designer wants.

--
Duane Hookom
MS Access MVP
--

PC Datasheet said:
DCount("*","TblAccounts","[Pending] >=1 And [Pending] <=2")

DCount("*","TblAccounts","[Pending] >=3 And [Pending] <=6")

DCount("*","TblAccounts","[Pending] >7")

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



zyus said:
I have a field name 'pending'. The field consist number from 0 to any
number.
In my report i want to count number of account with different range of
'pending' number.

Say pending from 1 to 2, or
3 to 6 or
above 7.

I tried to use this =Abs(Sum([pending]>1<2)) for the 1st defn but it
won't
work.

Thanks
 
Thank you......

Duane Hookom said:
Try:
=Abs(Sum([pending] Between 1 AND 2))

You would be better off if you create a table of min and max values with a
field for range title. You could add this to your report's record source and
set the criteria under the Pending field to
Between MinRange And MaxRange
Add the range title to the report so you could summarize your records by
range using data rather than hard-coded values.

--
Duane Hookom
MS Access MVP
--

zyus said:
I have a field name 'pending'. The field consist number from 0 to any
number.
In my report i want to count number of account with different range of
'pending' number.

Say pending from 1 to 2, or
3 to 6 or
above 7.

I tried to use this =Abs(Sum([pending]>1<2)) for the 1st defn but it won't
work.

Thanks
 
Back
Top