Results 1 to 4 of 4
  1. #1
    LanieB is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    54

    Iff Statement Question

    Hello Ladies and Gents~!



    This is the Iff statement I have. It's not working... I'm sure this is something SO EASY to fix but for the life of me I can't figure it out.

    I am trying to get a total number of how many files we have LEFT to audit. I created an expression to the [Number of files to Audit]-[Number Audited] = [Number of Files Left]
    If we haven't audited any for that paticular person that field comes back Null...
    I want this field to tell me the [Number of Files to Audit] if the [Number of Files Left] is Null... that way it is saying we have 30 files left to audit out of 30... rather than 'blank' out of 30.

    I hope this makes sense. Please let me know if you have any questions!

    Number Left: Iff([Number of Files Left]=NULL, [Number of Files To Audit], [Number of Files Left])

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Nothing is = NULL NULL is undefined.
    There is a function to see if a variable has an undefined (NULL) value.

    IsNull (your field)

    details at http://www.techonthenet.com/access/f...ced/isnull.php

  3. #3
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Maybe try one of these variations:

    Number_Left: Iff(IsNull([Number of Files Left]), [Number of Files To Audit], [Number of Files Left])
    or
    Number_Left: Iff(Nz([Number of Files Left],0)=0, [Number of Files To Audit], [Number of Files Left])

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    How about using the NZ() function (I removed the spaces in the field names)

    NumberOfFilesLeft: Nz([NumberOfFilesToAudit],0) - Nz([NumberAudited],0)

    OR

    Number_Left: Nz([NumberOfFilesToAudit],0) - Nz([NumberAudited],0)

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

Similar Threads

  1. Replies: 6
    Last Post: 01-05-2013, 05:23 PM
  2. if statement in sql statement, query builder
    By 54.69.6d.20 in forum Access
    Replies: 4
    Last Post: 09-11-2012, 07:38 AM
  3. Replies: 4
    Last Post: 08-25-2012, 07:19 PM
  4. Replies: 2
    Last Post: 10-13-2011, 09:14 AM
  5. Replies: 7
    Last Post: 08-17-2011, 01:49 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