Results 1 to 4 of 4
  1. #1
    breakingme10 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Oklahoma
    Posts
    153

    Help with a calculated query field for late status, only partially works

    My code works for the "Late" status but it won't show the "Unpaid"?



    Code:
    Status: IIf(Date()>[qry_Invoices].[DueDate],IIf(IsNull([qry_Invoices].[Payment]),"Late",IIf(IsNull([qry_Invoices].[Payment]),"Unpaid","Paid")))
    This is in a query for invoices to set the "Status" of an invoice to paid unpaid or late.


    EDIT: it still won't show "Paid"
    Last edited by breakingme10; 06-19-2014 at 03:46 PM. Reason: update

  2. #2
    breakingme10 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Oklahoma
    Posts
    153
    Of course i spoke too soon, this worked
    Code:
    Status: IIf(Date()>[DueDate],IIf(IsNull([Payment]),"Late",""),IIf(IsNull([Payment]),"Unpaid","Paid"))

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Try:

    Status: IIf(IsNull([Payment]), IIf(Date()>[DueDate], "Late", "Unpaid"), "Paid")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    breakingme10 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Oklahoma
    Posts
    153
    Status: IIf(IsNull([Payment]), IIf(Date()>[DueDate], "Late", "Unpaid"), "Paid")
    Worked perfectly! Can't believe how just switching the first iif statement to the payment being null instead of date makes such a difference!

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

Similar Threads

  1. Calculated Field in Query
    By roarcrm in forum Queries
    Replies: 1
    Last Post: 06-06-2014, 09:24 AM
  2. Replies: 4
    Last Post: 03-20-2014, 03:52 PM
  3. Replies: 3
    Last Post: 02-13-2013, 10:15 AM
  4. Replies: 3
    Last Post: 10-03-2010, 10:53 AM
  5. Replies: 2
    Last Post: 06-14-2010, 09:38 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