Results 1 to 3 of 3

Thread: Iif and SQL Server 2000

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Perth
    Posts
    2

    Iif and SQL Server 2000

    In Access 2000 you can execute a query like

    SELECT IIF([cyCompany]= '<No Company>',[HomeStreet],[CyBusinessStreet]) AS BusinessHomeStreet
    FROM Companies

    but in SQL Server 2000 it generates a problem. Does SQL Server 2000 supports this command and if no what's the best workaround?
    Steven Helsdingen
    [email protected]

  2. #2
    nullus
    Guest
    You could try using the CASE statement:

    Code:
    SELECT 
    CASE WHEN [cyCompany] = '<No Company>' THEN
      [HomeStreet]
    ELSE
      [CyBusinessStreet]
    END AS BusinessHomeStreet
    FROM Companies
    I use that in SQL Server7, so it should work in 2000.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Perth
    Posts
    2
    Thanks man. It works !!!
    Steven Helsdingen
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width