Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula - Subtracting Negative Numbers

Status
Not open for further replies.
Dec 11, 2009
60
US
I am stuck on this formula:

Total = columna - columnb (when b is a negative number it adds the 2 and the results come out incorrect)?

How can I get around this?

Thanks!!
 
I would point out that when b is a negative number adding the two is exactly the right answer mathmatically.

For instance, suppose you have cost records of some type and one record has a value of 165.00. When you later realize this was a mistake and want to zero it out, you put in a value of -165.00 effectively making the total 0. This is simply the way math works.

Rudy's answer gives you the absolute value (the value of the number without the sign) and it is appropriate for some uses but most of the time you want the normal workings of math to happen. Do no use ABS unless you understand why you are using it.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top