How to write code for Median

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Scldb
    New Member
    • Feb 2007
    • 29

    #1

    How to write code for Median

    I have a column that I what to show a negative number.
    The equation for this is:
    Unit Price % = ([Proposed Price]-[Current Price])/[Current Price]

    With Numbers it would be:
    Unit Price % = (378.62 - 382.44)/382.44

    Which is -1%
    But Access shows 0.00%

    Can I please get help. Thank you
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by Scldb
    I have a column that I what to show a negative number.
    The equation for this is:
    Unit Price % = ([Proposed Price]-[Current Price])/[Current Price]

    With Numbers it would be:
    Unit Price % = (378.62 - 382.44)/382.44

    Which is -1%
    But Access shows 0.00%

    Can I please get help. Thank you
    Code:
    Format((378.62 - 382.44)/382.44, "Percent")
    OUTPUT:
    Code:
    -1.00%

    Comment

    • Scldb
      New Member
      • Feb 2007
      • 29

      #3
      Originally posted by ADezii
      Code:
      Format((378.62 - 382.44)/382.44, "Percent")
      OUTPUT:
      Code:
      -1.00%
      Sorry, I forgot to tell you this part. The equation that I'm trying display will be on a table. I created the table, now I'm using an update query to update that column into a percentage of the equation. Every row will have different numbers, but utimately, the equation should be the same. I have the proposed price and current price on this same table and every row has different proposed prices and current prices - hence the "([Proposed Price]-[Current Price]/[Current Price])" equation.

      What you gave me "Format((37 8.62 - 382.44)/382.44, "Percent")" throws an error when I try to run the update query. So you have another suggestion?

      Comment

      Working...