Results 1 to 7 of 7
  1. #1
    todmac is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    20

    Using Between and IIF in a query paramater


    Hello All,
    I have the following query criteria and for some reason it will not work. It only brings up the records that have a value of "0"

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    I have the following query criteria
    And the criteria is???

  3. #3
    todmac is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    20
    Sorry, I posted before I got a change to paste it in.
    Code:
    Between IIf(IsNull([forms]![reports].[Amount_Claimed_Before_Tax_Start]),"0",[Forms]![Reports].[Amount_Claimed_Before_Tax_Start]) And IIf(IsNull([Forms]![Reports].[Amount_Claimed_Before_Tax_End]),"10000000",[Forms]![Reports].[Amount_Claimed_Before_tax_End])

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

    Between Nz([forms]![reports].[Amount_Claimed_Before_Tax_Start]),"0") And Nz([Forms]![Reports].[Amount_Claimed_Before_Tax_End]),"10000000")

    My gut feeling is that you don't want quotes around the numbers though.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    think you've got a couple of extra brackets there Paul

    Between Nz([forms]![reports].[Amount_Claimed_Before_Tax_Start]),"0") And Nz([Forms]![Reports].[Amount_Claimed_Before_Tax_End]),"10000000")

    don't think you need the ones in red

    And I agree about not needing the quotes around the numbers

  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,642
    Oops, you are correct. Lack of diligence during cut/paste operations.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    I do it all the time! Think you picked up one of mine the other day

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

Similar Threads

  1. report has extra paramater pop up
    By lisanoe in forum Reports
    Replies: 1
    Last Post: 02-03-2015, 01:35 PM
  2. Replies: 2
    Last Post: 12-07-2014, 10:03 PM
  3. Query Paramater Connection
    By magicmike92 in forum Queries
    Replies: 20
    Last Post: 08-13-2013, 02:57 PM
  4. Removed Enter Paramater Value
    By lsingh165 in forum Access
    Replies: 2
    Last Post: 01-28-2013, 12:52 AM
  5. Date Paramater prints weird
    By NOTLguy in forum Reports
    Replies: 9
    Last Post: 10-20-2010, 07:58 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