Results 1 to 8 of 8
  1. #1
    swagger18 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    19

    Turning a Value into a positive

    Afternoon,

    I work for a company who are rapidly growing in size. We have a quality control system which at the moment is all held in a Excel spreadsheet. As you can imagine the bigger it gets the slower and slower it runs. I am currently converting these spreadsheets into a database structure. I am using SQL Server 2005 as the back end and Microsoft Access 2003 as the front end.

    I have ran into a slight problem with one of the formulaes i am trying to convert.

    The Formulae as it is in Excel is below:

    =+(FieldA-FieldB)*100/FieldC



    When i try to convert this into Access as below:

    Field4 = + (FieldA - FieldB) * 100 / Field3

    The plus symbol is disappearing and it is given me negative values. My first thought was the original formulae that was written is wrong as it has to have a plus value in it to compensate for that, but thought i would post it on here in hope there was away of getting around it.

    Cheers in advance

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    for a + value, use the ABS()

    make sure you understand the directives for order of operations. Yeah, programs follow that too, just like your math teacher taught you.

  3. #3
    swagger18 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    19
    Thank you very much for that works a treat.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    solved........

  5. #5
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I was playing around in Excel and saw no difference in final results using the same formula with the + or without it. Whether the result is positive or negative depends on the variables going into the formula.

    In terms of relational databases (Access or SQL Server) you generally would not store the calculated value anyway. You would only store the pertinent values that are used in the calculation. You would do the calculation on the fly in your forms, reports or queries.

  6. #6
    swagger18 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    19
    I am doing the calculation in a form and using all the original data it was giving me a neagtive. ajetrumpet solved it for me and is working correctly now.

  7. #7
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I had started working on my post before ajetrumpet posted his but due to distractions here at work mine came in later. Glad that you the ABS() function worked out for you.

  8. #8
    swagger18 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    19
    Ok cheers for your input. Kindly appreciated.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-20-2010, 02:22 PM
  2. Convert Negative Values to Positive
    By creativefusion in forum Queries
    Replies: 1
    Last Post: 10-21-2009, 02:47 AM
  3. Turning Combobox to Dropdownlist
    By jonny in forum Access
    Replies: 1
    Last Post: 10-19-2009, 04:33 AM
  4. Suming Positive Numbers Only
    By jbarrum in forum Access
    Replies: 5
    Last Post: 04-24-2009, 03:51 PM
  5. Matching positive with negative amounts
    By cwert11 in forum Access
    Replies: 1
    Last Post: 09-29-2008, 12:26 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