IIF Statement in SQL

Posted on 2005-04-18
Last Modified: 2011-10-03
I would usually use the following statment in microsoft access, however I can't get it to work in SQL server any ideas

SELECT IIf([AddressedDate] Is Null,[TargetDate],[PredictedCompletion]) AS [Order], * FROM Tjobrecord;

Question by:Sometimes
    LVL 26

    Accepted Solution

    Please try

    SELECT case when [AddressedDate] Is Null then [TargetDate] else [PredictedCompletion] end AS [Order], * FROM Tjobrecord;
    LVL 2

    Author Comment


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now