Results 1 to 6 of 6
  1. #1
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    How To XDetail: IIf([Pending Bill Amounts]=0 & <0 & >1,Null,[PurDetail])

    XDetail: IIf([Pending Bill Amounts]=0 & <0 & >1,Null,[PurDetail])



    How to Write this correctly

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It doesn't make any sense to me. What amount would be excluded if you test for all 3? In words, what do you want the test to be?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Apr 2017
    Posts
    1,792
    I'd prefer (as a rule, arithmetical/logical expressions work faster then functions)
    Code:
    ([Pending Bill Amounts]>0)*([Pending Bill Amounts]<=1)*[Pending Bill Amounts]

    NB! In case the number of logical expressions in formula is odd, you have to multiply the result with (-1).

    Edit: I missed that you wanted Null returned in case False. So:
    Code:
    Iif(And([Pending Bill Amounts]>0,[Pending Bill Amounts]<=1),[Pending Bill Amounts],Null)

  4. #4
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    There is code is giving error

    Iif(And([Pending Bill Amounts]>0,[Pending Bill Amounts]<=1),[Pending Bill Amounts],Null)

  5. #5
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    zero value should be excluded and to show as null value

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    That's Excel. Try

    Iif([Pending Bill Amounts]>0 AND [Pending Bill Amounts]<=1),[Pending Bill Amounts],Null)

    Though you may want to check your logic.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 07-01-2019, 11:32 AM
  2. Replies: 13
    Last Post: 01-21-2018, 08:55 PM
  3. Replies: 4
    Last Post: 01-13-2016, 05:45 AM
  4. Replies: 4
    Last Post: 04-22-2015, 05:46 PM
  5. Only display pending orders in report?
    By AThomas in forum Reports
    Replies: 5
    Last Post: 01-24-2012, 08:45 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