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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number Always Negative 1

Status
Not open for further replies.

mdjoin

Programmer
Jun 22, 2007
9
US
Hello All,

I am needing to take a number field and make sure it always calculates as a negative value. I have done this by formatting the number field to reverse, but I just ran into an issue where one person sent us their information with the negative value in the database, thus it adds instead of subtracts this value.

Example:

Database Shows: $-100.00
Report Displays: $100.00

Normally it should be:

Database: $100.00
Report Displays: $-100.00

Is there anyway to force a number to always be negative even if it is negative in the database?

Thanks,
 
Use a formula to test if the value out of the database is less than 0, and if so return that value, otherwise multiply by -1

if yourvalue < 0
then yourvalue
else yourvalue * -1
 
Thanks a ton! worked like a charm.
 
Or try:

-abs({YourField})

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top