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

Sorting on a Converted String Column

Status
Not open for further replies.

mpvel

Technical User
Apr 29, 2005
10
0
0
US
I have a number field and I am using a formula to print string '-' when there is null value. I could remove decimals and zero's in the Cstr function. Now how can I sort this column.

If isnull({tablename.fieldname}) then
formula = "-"
else
formula = Cstr({tablename.fieldname},0,"")
end if

Please share any ideas how can I acheive this?
I used to show all zero's before, even for the null's in the database. users wanted me to show '-' for Null and show 0 for 0 in the database.
 
Sort on the original field, and then use your formula only for display purposes within the report.

A numeric converted to string will not sort as you need, as you've discovered, so sort on the numeric (use the pull down Report-Sort Expert).

-k
 
Thanks a lot for your valuable suggestion. I tried sorting using the formula. Now as you said I sorted the table field and displayed the formula on the report as usaul. It works great.

MP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top