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 TouchToneTommy 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 records by formula in CR 8?

Status
Not open for further replies.

omargpe

IS-IT--Management
Feb 5, 2003
22
US
hi i'm using crystal reports verion 8.0...
and i'd like to know if is there a function to sort in the "Group Selection Formula Editor" area...
because i want that my report can be sorted by a parameter field (value type=number), this parameter would has three options 1='By Name', 2='By Date' and 3='By Area'...
and there are 3 database fields, one of each option...

So if is there a function or another option to do this, and someone knows please tell me...

tnxs

Salu2
()|\/|@®
 
Dear omarge,

You can do this:

Create a parameter - call it what you want - ReportSort and then add the default values:

By Name
By Date
By Area

Next create the formula you will use to group:

//@Grouper

Select {?ReportSort}
Case "By Name" : {Table.NameField}
Case "By Date" : Totext({Table.DateField},"MM/dd/yyyy")
Case "By Area" : {Table.AreaField}

Save the formula and choose Insert/Group and choose the @Grouper formula for your group.

Regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
This is unrelated to the group selection area. What you would do is create a formula like this:

select {?parm}
case 1 : {table.name}
case 2 : totext({table.date},"yyyy/MM/dd")
case 3 : {table.area}

Then group on this formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top