Hey I have a question for MS Access.
In Excel I would use the function =countif(A1:$A$2000; $B$3). So it only counts the ones in the same row and below.
How do I do that in MS Access? Something like count(iff([]))?
Cheers
CodePudding user response:
Actually, there is an IIF function in ms-access. You can get the count if with a pipeline like:
SELECT Sum(IIf(id / 2 = id \ 2, 1, 0)) AS sum_of_even
FROM table;
In this case you obtain the sum of even ids. You can change the condition id / 2 = id \ 2
as you wish.
CodePudding user response:
try this
counttotal: Count(IIf([credit]<20000,[credit],Null))
where credit is name of column, and you want to count the number of records where the value in the credit column is less than to 20,000