From: Qaspec on
What is the SQL Case Statement equivalent to the following SQL expression in
Access?
Thanks for any help.

Count(IIf([HourCreated]=7,0)) AS 7
From: --CELKO-- on
>> Count(IIf([HourCreated]=7,0)) AS 7 <<

None; you cannot name a data element 7 without using quoted
identifiers. I think you might want:

COUNT(NULLIF(creation_hr, 7)) AS seven

From: Tony Rogerson on
case when HourCreated = 7 then 0 else null end AS [7]

But you seem to be missing the "false" value so I've used Null above.

Tony.

"Qaspec" <Qaspec(a)discussions.microsoft.com> wrote in message
news:CAA1B9F8-87D6-4188-95D3-225A86239BC6(a)microsoft.com...
> What is the SQL Case Statement equivalent to the following SQL expression
> in
> Access?
> Thanks for any help.
>
> Count(IIf([HourCreated]=7,0)) AS 7