Results 1 to 5 of 5
  1. #1
    ATTHECROSS is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    14

    JoeM... I had one more question after your help from yesterday

    JoeM -



    Since I already clicked "solved" I couldn't reply to ask you another question about my original post. Yesterday I asked about the code for obtaining an output of "true" "false" from two tables in one query and you provided the code...Check: IIF([Table1].[Field1]=[Table2].[Field1],True,False. It worked great, as I said, except when both "Field1" and "Field2" from their respective tables are both BLANK the value of "FALSE" is returned when it should be "true". I checked to make sure that the data was correctly scrubbed so that there weren't any hidden spaces or other issues and the data is good to go. I even tried it as the boolean values as you suggested and I still get a "0" for the instances where both fields are blank.

    Any thoughts on how to fix this? Thanks for the help





  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Access does not really like null values. A null value is not equal to another null value.
    The key is to use the Nz function, which converts a Null value to a value of your choosing.

    So, try something like:
    Code:
    IIF(Nz([Table1].[Field1],"Empty")=Nz([Table2].[Field1],"Empty"),True,False)
    By the way, I think you can still post to that other thread. It isn't locked out or anything. The "Solved" is just a flag to let people know at a glance that it has been solved.
    But you can still reply to it, and I will see those.

  3. #3
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    Code:
    IIF( ([Table1].[Field1] = [Table2].[Field1]) OR ([Table1].[Field1] Is Null AND [Table2].[Field1] Is Null) , True, False)

  4. #4
    ATTHECROSS is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    14
    JoeM -

    Thank you for the help! Really appreciate it! Worked perfectly. Have a good one

  5. #5
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome.

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

Similar Threads

  1. Running Macro for yesterday's date
    By mjburne88 in forum Macros
    Replies: 3
    Last Post: 09-24-2015, 10:06 AM
  2. Yesterday's Date ignoring weekends
    By coletteabrown in forum Access
    Replies: 4
    Last Post: 12-09-2013, 08:02 AM
  3. Replies: 6
    Last Post: 10-05-2012, 02:38 PM
  4. database worked yesterday and not today
    By ctbrown4 in forum Database Design
    Replies: 2
    Last Post: 08-17-2012, 08:43 AM
  5. Query re-run for Tomorrow/Yesterday
    By mseeker22 in forum Queries
    Replies: 3
    Last Post: 06-13-2011, 11:14 AM

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