Results 1 to 4 of 4
  1. #1
    forbudt4u is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    10

    Percentage Expression Help...


    Click image for larger version. 

Name:	Missing Asset Report.JPG 
Views:	13 
Size:	56.8 KB 
ID:	42454

    Okay, I am new to Access expressions, but have many years of experience with Excel.... so I can get this to work quite easily in Excel, but can't figure it out in an Access Report I have built. I have included a screen-cap of the report I have made and as you can see, the % Missing (by $) in the far right column is blank, as this is where I'm having my issue. The report is grouped by Holder with the details hidden as I am only producing a summary report. I get the correct corresponding count and value for all of the listed Holder's Assets. What I'm trying to do is this...

    Each Holder has Assets that fall into different status' (such as assigned, damaged, missing... etc). I need the expression to sum the total dollar amount for just the assets that user has listed as MISSING status and then dividing that amount by the total asset value so I can get a percentage of that holders missing assets based on dollar amount. The field names from my table is as follows:

    [Holder] - Self explanatory... report already grouping the correct way
    [Status] - "Missing" Assets only
    [Current Value] - Dollar amount assigned to the respective asset's record
    [Asset Value #] - The Report Field that already calculates the TOTAL dollar amount for all asset's assigned, regardless of status for the given Holder

    Any guidance you guys could give would be appreciated!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    add a text box with the formula:
    =txtBoxAmt / txtBoxAssetVal

    set the format property to %,
    and the # decimals.

    Note, the formulas use TEXT BOX NAMES, not field names. (but they could both be the same name)

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Expression like:

    =Sum(IIf(Status="Missing", [Current Value], Null))/Sum([Current Value])

    Advise not to use spaces nor punctuation/special characters in naming convention.
    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
    forbudt4u is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    10
    June7, yours did it... thank you!!! I actually changed it to =Nz(Sum(IIf(Status="Missing", [Current Value], Null))/Sum([Current Value]),0) because I forgot to mention I needed to it say 0% if the holder didn't have missing assets. Also, in regards to your advice on the spaces and characters... I totally agree it's good habit, but my grammar OCD'ness gets the best of me

    Ranman... appreciate the terminology lesson - I forget I'm in a different world with Access, will have to get used to this.

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

Similar Threads

  1. Replies: 2
    Last Post: 03-11-2019, 01:26 PM
  2. Replies: 2
    Last Post: 11-16-2017, 03:33 AM
  3. percentage
    By angie in forum Forms
    Replies: 1
    Last Post: 08-13-2017, 02:11 PM
  4. Replies: 4
    Last Post: 05-03-2016, 01:51 PM
  5. Replies: 2
    Last Post: 11-20-2012, 03:21 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