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

Reversing The Sign On Account Balances 2

Status
Not open for further replies.

Ktwhite

Technical User
Mar 6, 2003
23
0
0
US
I am attempting to reverse the sign for all instances in a particular column of a report where the sign is negative. Since each column includes revenue in expense accounts, simply selecting; "reverse sign for display" within the format editor will not work for all instances. I am not sure how to use the Sgn formula function in Crystal Reports. My Current Formula reads as follows:
If Sgn (BAL)<0 Then Sgn(BAL) = (-1).
Is this the correct Syntax to Reverse the SIGN only, and only affecting negative balances? Ken
 
under the X-2 by Reverse sign for Display, simply type in Bal < 0

hope this helps.
dlc
 
If you provide sample data and expected output, you'll get better results.

I assume that reversing the negative means that everything will be positive, so just right click the field and select format field->Customize->Number-> and set Negatives to None.

The SGN function returns the value of the sign of a field, such as

Sgn (-1)

Returns -1.

Sgn (0)

Returns 0.

Sgn (1)

Returns 1.

This allows you to test for the state.

-k
 
Thank you for clearing this up for me. &quot;Setting Negatives to None&quot; or typing Bal < 0 in the x-2 by Reverse Sign for Display both work fine, and a lot simpler than my approach.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top