Results 1 to 4 of 4
  1. #1
    rlsublime is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2012
    Posts
    58

    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
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228
    if i understood correctly, try:
    IIf([ORIGINAL_LOCK] Is Null,[new_App_DT],IIf([ORIGINAL_LOCK] is not Between [Forms]![DateFilter].[dtStart] And [Forms]![DateFilter].[dtEnd], [new_App_DT], [ORIGINAL_LOCK]))

  3. #3
    rlsublime is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2012
    Posts
    58
    That statement was giving me the following error message: 'The expression you entered contains invalid syntax' Any idea what might be wrong with the statement? Thanks


    Quote Originally Posted by mejia.j88 View Post
    if i understood correctly, try:
    IIf([ORIGINAL_LOCK] Is Null,[new_App_DT],IIf([ORIGINAL_LOCK] is not Between [Forms]![DateFilter].[dtStart] And [Forms]![DateFilter].[dtEnd], [new_App_DT], [ORIGINAL_LOCK]))

  4. #4
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228
    IIf([ORIGINAL_LOCK] Is Null,[new_App_DT],IIf([ORIGINAL_LOCK] < [Forms]![DateFilter].[dtStart] or [ORIGINAL_LOCK] > [Forms]![DateFilter].[dtEnd], [new_App_DT], [ORIGINAL_LOCK]))

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-14-2011, 07:03 PM
  2. Replies: 1
    Last Post: 09-20-2011, 07:28 PM
  3. Multiple SQL Statements
    By springboardjg in forum Queries
    Replies: 1
    Last Post: 04-18-2011, 10:32 AM
  4. Multiple IIF statements
    By KevinMCB in forum Queries
    Replies: 4
    Last Post: 12-03-2010, 01:35 PM
  5. Replies: 3
    Last Post: 10-13-2010, 03:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums