[AccessD] Re: IIF statement

Robert L. Stewart rl_stewart at highstream.net
Fri Mar 5 11:08:30 CST 2004


If it is T-SQL, then you will have to use the
CASE statement because there is no IIF in it.

SELECT Dept, [MS Date Opened], MID_Date_Opened,
      CASE
           WHEN Dept = 'MSS' THEN [MS Date Opened]
           WHEN Dept = 'MID' THEN [MS Date Opened]
           WHEN Dept = 'SW' THEN [MS Date Opened]
           WHEN Dept = 'OW' THEN [MS Date Opened]
           ELSE MID_Date_Opened
      END AS NewDateOpened
FROM [Ron Data mid]

Oleg, you really need to get rid of the spaces in your column and table 
names!!!!!!

Robert



At 09:15 AM 3/5/2004 -0600, you wrote:
>Date: Fri, 5 Mar 2004 15:35:07 +0100
>From: Gustav Brock <gustav at cactus.dk>
>Subject: Re: [AccessD] IIF statement
>To: Access Developers discussion and problem solving
>         <accessd at databaseadvisors.com>
>Message-ID: <323397654.20040305153507 at cactus.dk>
>Content-Type: text/plain; charset=us-ascii
>
>Hi Oleg
>
>Don't know much about T-SQL but how about this:
>
>   (IIf([Ron Data mid].DEPT In ("MSS","MID","SW","OW"),
>   [Ron Data mid].[MS Date Opened]), [MID_Date_Opened])
>   AS NewDateOpened,
>
>
>/gustav





More information about the AccessD mailing list