iif function
Hello,
I'm trying use the iff function in a query and can't seem to get it to work.
Below is an example of the query. If anyone can give me a hint or two, I'd
greatly appreciate it. Thanks!
----------------------
select col1, col2, col3,
sum(col1 + col2 + col3) as col_sum,
IIf((col1 > 0), 1, 0) AS col_ans
from table1
group by col1, col2, col3
----------------------
[430 byte] By [
Jon] at [2007-11-9 21:10:29]

# 1 Re: iif function
see http://www.mssqlserver.com/faq/development-iif.asp
"Jon" <jon242@yahoo.com> wrote in message news:3da1a78d$1@10.1.10.29...
>
> Hello,
>
> I'm trying use the iff function in a query and can't seem to get it to
work.
> Below is an example of the query. If anyone can give me a hint or two, I'd
> greatly appreciate it. Thanks!
> ----------------------
> select col1, col2, col3,
> sum(col1 + col2 + col3) as col_sum,
> IIf((col1 > 0), 1, 0) AS col_ans
> from table1
> group by col1, col2, col3
> ----------------------