I need to count how much "assenze" I have in this query, as cover is a text
field I try to use the IIF as you can see below. BUT It does work! Damn.
Query = "SELECT Sum(IIF(cover = 'NO', 1, 0)) as assenze, SUM(stato) as
daypresidio FROM copertura WHERE day between '11/12/2005' and '11/18/2005'
Group by day ORDER BY day ASC"
Please Help
Norman Yuan - 10 Nov 2005 14:13 GMT
Since you post in Access.adp.sqlserver NG, I assume your query is going to
run on Sql Server/MSDE.
There is no IIF... in T-SQL, you use CASE... instead:
SELECT
SUM
(
CASE
WHEN conver='NO' THEN 1
ELSE 0
END
) AS assenze,
SUM(stato) AS daypresido
FROM
....
>I need to count how much "assenze" I have in this query, as cover is a text
>field I try to use the IIF as you can see below. BUT It does work! Damn.
[quoted text clipped - 4 lines]
>
> Please Help
WebRaster - 11 Nov 2005 16:46 GMT
Thank you very much.
> Since you post in Access.adp.sqlserver NG, I assume your query is going to
> run on Sql Server/MSDE.
[quoted text clipped - 22 lines]
>>
>> Please Help