IIF function in view ??? 
Author Message
 IIF function in view ???
Who can help me.
I'm trying te create a view with the iif (immediate if) function, however
without success so far.
I keep getting the message that I made a syntax error somewhere near the =
symbol.

I used to run an application with several queries under Access97. After
upgrading all to SQL server 7, everything works, except for the views (as
created from the queries) which contain iif statements.

Can someone help me with the syntax.
thanx
regards,
c.j.



Sat, 17 May 2003 03:00:00 GMT
 IIF function in view ???

C.J.,

IIF() is not supported by T-SQL; you can use a CASE expression instead.
Instead of IIF(<condition>, <return value if true>, <return value if
false>), use:

CASE
  WHEN <condition> THEN <return value if true>
  ELSE <return value if false or unknown>
END

--
BG

Hi-Tech College, Israel
http://sql.hi-tech.co.il


Quote:
> Who can help me.
> I'm trying te create a view with the iif (immediate if) function, however
> without success so far.
> I keep getting the message that I made a syntax error somewhere near the =
> symbol.

> I used to run an application with several queries under Access97. After
> upgrading all to SQL server 7, everything works, except for the views (as
> created from the queries) which contain iif statements.

> Can someone help me with the syntax.
> thanx
> regards,
> c.j.



Sat, 17 May 2003 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. iif function in views

2. iif functions in views / procedures

3. Simulating IIF function in View

4. IIF function inside a view

5. How to use IIF function in a view

6. IIF or CASE type function in SQL views

7. IIF FUNCTION IN A VIEW

8. IIF Function not recognized as valid function

9. equivalent for IIF (in VIEWS)

10. decode or iif in SQL 7 view?

11. Using IIF in a View

12. How to se IIF or Case statements in a view to create a column


 
Powered by phpBB® Forum Software