Sunday, March 25, 2012

Converting Access 2000 Query - IIf statement to SQL Server 2000 Vi

I have a field in the query where I count the tech_area field. I have an Ii
f
(Count Of([tech_field])=0, CountOf([id]),CountOf[tech_field]).
My question is how do I translate that in SQL Server? I tried to write the
query using the new view window but I kept erroring when I put the IIf
statement in.
Any help would be greatly appreciated.
Thx,
CLMYou can use a Case expression instead. There is no IIF in
T-SQL or ANSI SQL. You can find more information and some
examples of using Case in SQL Server books online.
-Sue
On Mon, 21 Mar 2005 14:27:02 -0800, CLM
<CLM@.discussions.microsoft.com> wrote:

>I have a field in the query where I count the tech_area field. I have an I
if
>(Count Of([tech_field])=0, CountOf([id]),CountOf[tech_field]).
>My question is how do I translate that in SQL Server? I tried to write the
>query using the new view window but I kept erroring when I put the IIf
>statement in.
>Any help would be greatly appreciated.
>Thx,
>CLMsqlsql

No comments:

Post a Comment