>I'm trying to create a single SQL statement which will give a number of different count(conditional) reading the same variable.
>
>What I tried is using "sum(IIF(,,)) as xxx" several times in my select.
>Here is an instance of what I did.
>
>SELECT sum(IIF(rrspcont = 0,1,0)) as rrsp0,
> sum(IIF(rrspcont = 1,1,0)) as rrsp1, and so fourth
>FROM...
>
>Can I group the IIF in another IIF and still keep the same results?
>(sum(IIF(rrspcont = 0,1, IIF(...) without changing the variable
>name to store the result?
>
>Does anyone know if this is possible?
yep - you can nest IIF()s within a SELECT statement assignment. It's ugly and unreadable, but it can be (and, in my case, has been) done before. In most cases, rethinking the SELECT with nested IIF()s into a SELECT and a CrossTab is far more flexible and maintainable.