Converting negative values to positive

T

Tony

Hello,

I have a table of Sales Orders. In the table the quantity
field reflects negative values that is outgoing stock,
which is correct. I need to convert those negative values
to positive values for other calculations but negatives
will not work. Any assitance on this is much appreciated.

Thanks in advance!

Tony
 
D

Dirk Goldgar

Tony said:
Hello,

I have a table of Sales Orders. In the table the quantity
field reflects negative values that is outgoing stock,
which is correct. I need to convert those negative values
to positive values for other calculations but negatives
will not work. Any assitance on this is much appreciated.

Where are you doing these calculations? If you're doing them in a query
you can just use the minus operator (-) to flip the sign of the Quantity
field; for example:

ExtendedPrice: -Quantity * Price

If you're using VBA code you can do pretty much the same thing:

ExtendedPrice = --Quantity * Price

If that doesn't nswer your question, I'm afraid you'll have to explain
in more detail where the problem is.
 
R

RobFMS

You could also use the ABS() function. (Absolute)

Returns the absolute value of a number, which is a number without its sign.

Example: -45 -> Abs(-45) = 45

HTH

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top