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

How to sort negative and positive balance

Status
Not open for further replies.

vshapiro

Programmer
Jan 2, 2003
211
US
Hello,
It should be easy but I connot find a way to do it:
I have a field - Balance Due which contain positive and negative dollar amounts. When I sorting it goes dollar amount without paying attention if this is positive or negative.
I need to sort all negative and then all positive...

It looks like:

5.00
6.00
-7.00
8.50
9.25
-10.50
11.00

And I need:
-10.50
-7.00
5.00
6.00....etc........

thank you
 
If you have added the field to Report, Sort Records as ASC, and the field is numeric, you shouldn't have a problem.

Is your field a string? If it is, you will need to create a formula that will convert it to numeric.
Code:
ToNumber({table.field})
Now add this to Report, Sort Records as ASC.

~Brian
 
This is numeric field but I needed to convert it to string because I have a parameter SORT which contain many different fields and then I grouped by this SORT so user can select field which he can sort by. I need to have all fields string because if I am leaving this field numeric it gives me error. What should I do??
 
Have a look at the formatting options of the ToText()function. I use this frequently to sort on numeric fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top