HELP: must convert IIF( ) from Access queries to T-SQL 
Author Message
 HELP: must convert IIF( ) from Access queries to T-SQL
Hi all,

I'm new to T-SQL and SQL Server 2000 and am trying to convert my "old"
Access queries into views and SP's.

Does anybody know an easy way to get the IIF()-functionality, which is
heavily used in my queries, into SQL Server views using T-SQL ? I've tried
various combinations of NULLIF, ISNULL and CONVERT, and in some cases it
worked, but it made my SQL look really terrible.

There must be an elegant way to do the job, or a function I've overlooked.

ANY help is appreciated.

ErikM1964



Sun, 06 Feb 2005 04:46:35 GMT
 HELP: must convert IIF( ) from Access queries to T-SQL

Check out CASE... it does more or less what IIF does


Quote:
> Hi all,

> I'm new to T-SQL and SQL Server 2000 and am trying to convert my "old"
> Access queries into views and SP's.

> Does anybody know an easy way to get the IIF()-functionality, which is
> heavily used in my queries, into SQL Server views using T-SQL ? I've tried
> various combinations of NULLIF, ISNULL and CONVERT, and in some cases it
> worked, but it made my SQL look really terrible.

> There must be an elegant way to do the job, or a function I've overlooked.

> ANY help is appreciated.

> ErikM1964



Sun, 06 Feb 2005 06:40:52 GMT
 HELP: must convert IIF( ) from Access queries to T-SQL
Hey, I found out myself: I CAN use CASE .. WHEN .. ELSE .. END in views, I
just can't show this construction in the view designer (oh, THAT's what the
message says...). Sorry for being so ignorant ;-)



Quote:
> Hi all,

> I'm new to T-SQL and SQL Server 2000 and am trying to convert my "old"
> Access queries into views and SP's.

> Does anybody know an easy way to get the IIF()-functionality, which is
> heavily used in my queries, into SQL Server views using T-SQL ? I've tried
> various combinations of NULLIF, ISNULL and CONVERT, and in some cases it
> worked, but it made my SQL look really terrible.

> There must be an elegant way to do the job, or a function I've overlooked.

> ANY help is appreciated.

> ErikM1964



Sun, 06 Feb 2005 06:53:09 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. SQL To ORACLE Help Help Help Help Help

2. MS Access 97 SQL to MS SQL SQL SQL SQL

3. query:HELP! HELP HELP HELP HELP

4. help: How to use access upsizing tool to change access database to sql database

5. Help!!!!!SQL Server Error 2: ODBC SQL Server Driver(DBNMPNTW) Access Denied

6. Access 97 to SQL Server 2000 Enterprise T-SQL ODBC help

7. Help!!!!!!!!!SQL Server Error2: ODBC SQL Server Driver(DBNMPNTW) Access Denied

8. Error running script: messages.sql (1) during SQL 7.0 upgrade to SQL 2000 Help

9. HELP HELP HELP HELP!

10. HELP: Upsizing MS Access to SQL Error -7772

11. Need Help with Work around: Updatable Recordset on Access Form , sql server 2000

12. Access to SQL Server HELP!


 
Powered by phpBB® Forum Software