| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
Countif
Hey there,
Is there a quick expression to put in the control source area of a field on a report that says COUNTIF([Sample Text Field] = "NO") I would like it to only count the occurrences of NO. |
| Sponsored Links |
|
#2
|
||||
|
||||
|
There is no COUNTIF in access, but you could put a field on your report which has
Code:
IIF([Sample Text Field]="NO",1,0) |
|
#3
|
|||
|
|||
|
=Sum(Iif([YourField]=No,1,0))
|
|
#4
|
|||
|
|||
|
Re: Countif
Quote:
Help? |
|
#5
|
|||
|
|||
|
Re: Countif
Although the new text box with the IIF statement will show the result for each record you cannot perform Totals calculations on the box.
Totals are performed on fields in the Record Source. You need to add the IIF expression as a field in the Record Source query of your report. Also you will want to SUM the [Error Count] field to get the total of "NO" values. COUNT will just give you the total number of records regardless of their value. You do not need to include the [Error Count] textbox on the report at all. It just needs to be a field in the Record Source. |
|
#6
|
|||
|
|||
|
Re: Countif
Thanks Galaxiom. That was my issue. I kept trying to sum at report level and it was giving an error message. Once I plugged in the formula at the record source level and then just summed at report level it worked perfectly. Thanks again.
|
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access Equivalent to Excel's COUNTIF function?? | CliffHanger9 | General | 4 | 01-06-2005 10:32 AM |
| Counting records using SQL and writing to a table. | TheTrainMan | Modules & VBA | 9 | 09-02-2004 04:50 AM |
| Is there an Excel CountIf Function in Access | jonnymac1979 | General | 8 | 09-01-2004 12:17 AM |
| COUNTIF - Quite urgent | morlan | General | 2 | 05-13-2003 08:40 AM |
| CountIf function | AnnPhil | Reports | 1 | 06-09-2002 09:21 PM |