+ Reply to Thread
Results 1 to 2 of 2

Multiple iif statements

  1. #1
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Multiple iif statements

    I am trying to combine two iif statements and I am trying enter the correct iif statement for it. This is what I have so far.

    Original iif statement that exists
    IIf([ORIGINAL_LOCK] Is Null,[new_App_DT],[ORIGINAL_LOCK])

    I am trying to add another iif statement to the existing iif statement with the following methodology.
    Iif original lock does not fall within the filter below, then change [ORIGINAL_LOCK] to [new_App_DT] otherwise leave as [ORIGINAL_LOCK]

    Between [Forms]![DateFilter].[dtStart] And [Forms]![DateFilter].[dtEnd]


    Would the new combined iif statement look something like this?
    (IIf([ORIGINAL_LOCK] Is Null,[new_App_DT],[ORIGINAL_LOCK]),
    IIf([ORIGINAL_LOCK] is not Between [Forms]![DateFilter].[dtStart] And [Forms]![DateFilter].[dtEnd], [new_App_DT], [ORIGINAL_LOCK]))

    Thanks for the help

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Multiple iif statements

    What happens when you run the statement as shown?

    Here is what MS has to say about IIF statements. Scroll down to the examples. There is a between clause. Yours looks right.
    http://office.microsoft.com/en-us/ac...001228853.aspx
    Did you test it?

    Just saw that you have the false result in twice. Remove the first one and replace it with the second IIF clause.

    Access uses the same concept as Excel for nested IIF statements. Look at this
    http://www.techonthenet.com/excel/fo.../if_nested.php

    Alan
    Last edited by alansidman; 04-25-2012 at 04:37 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1