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

Sorting Issue 1

Status
Not open for further replies.

AcctSolver

Technical User
Sep 27, 2003
28
US
I have a report with a parameter identifying it as detail or summary. For the summary version I have one group in my report; vendor ID. I want to be able to subtotal by that group, in group decending order. That part works fine. Next, based upon choosing a detail parameter, I need the report to sort by check number only, disregarding the group or vendor ID. What steps would I take to make that happen? I can suppress the group totals from printing in the detail version, but I wind up with the checks still having a primary sort based upon vendor, which I don't want.
 
Set up a formula to sort on. It will look something like this:

If {?MyParameter} = 'Summary' then
{table.VendorID}
else
{table.CheckNumber}

Both fields have to have the same data type. If they don't, you'll have to convert one of them. If one is a number and one is text, you'll have to convert the number to text which can be a challenge to get in numeric order (like 1, 2, 3, 11, 22, 33) instead of text order (like 1, 11, 2, 22, 3, 33). If you need to do this conversion, you'll do something like this:

right('00000' + ToText({table.field}, 0), 6)

Use the same number of zeroes as the field width - 1 and the final number in the right function should be the width of the field.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top