1

Topic: In Count to deduce 0

All greetings.
Prompt request which returned an amount "Handed over". The screen is applied
Ivanov 2
Petrov 1
Sidorov 0
Pavels 0

2

Re: In Count to deduce 0

SELECT Fam, SUM (IIF (Res = "Handed over", 1,0))
FROM table
GROUP BY Fam

3

Re: In Count to deduce 0

VladArk;

Select Fam, Sum (iif (Res = "Handed over"; 1; 0)) as CntRes
From....

But it is not exact

4

Re: In Count to deduce 0

Akina, ...

5

Re: In Count to deduce 0

Akina, Thanks big. And that and continued to use exists with 3rd nesting level smile

6

Re: In Count to deduce 0

VladArk;
It is possible and so:

.....-Sum (Res = "HANDED over") AS it is handed over,-Sum ([Res = "DID NOT HAND over") AS it is not handed over....