Results 1 to 5 of 5
  1. #1
    Rustyone is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    3

    Question Need help with a report expression

    It has been awhile since I worked in access.



    Text24 and Text 35 are a number.

    The first part(IIf) of this works. My problem is the second part(IIf) does not work. What am I doing wrong?


    =IIf([Text24]>11,[Text35]+500,IIf([Text24]>15,[Text35]+750))

  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,521
    Logic problem. If a value is greater than 15, it's also greater than 11. Access uses the first true expression.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Rustyone is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    Logic problem. If a value is greater than 15, it's also greater than 11. Access uses the first true expression.
    so would this work?

    =IIf([Text24]>11<15,[Text35]+500,IIf([Text24]>15,[Text35]+750))

  4. #4
    Rustyone is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    3
    I am try to get this to recalculate at each level cumulatively 12 =500, 16=250, 20=250, 24=250, 28=250

    12 =500
    16= 750
    20=1000

    Etc.Etc

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No, that wouldn't work. You'd test for greater than 15, then greater than 11. In other words highest to lowest. With that many, I'd use the Switch() function or a custom function, or put the values in a table.
    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: 05-10-2013, 03:37 PM
  2. Using an Iif expression in a report
    By jsfasman in forum Reports
    Replies: 2
    Last Post: 04-28-2013, 11:58 AM
  3. Expression on Report #Name?
    By burrina in forum Reports
    Replies: 0
    Last Post: 01-06-2013, 02:42 AM
  4. Report Expression Building
    By KMac in forum Reports
    Replies: 7
    Last Post: 12-07-2012, 11:29 AM
  5. Report - Expression Builder
    By AndreasPanayiotou in forum Reports
    Replies: 3
    Last Post: 09-16-2012, 01:10 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