Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Creating a sort Ascending Descending Parameter Post Reply Post New Topic
Author Message
new2crystal1980
Newbie
Newbie


Joined: 13 May 2010
Online Status: Offline
Posts: 6
Quote new2crystal1980 Replybullet Topic: Creating a sort Ascending Descending Parameter
     Posted: 14 May 2010 at 12:10am
Hi all,
 
I have made a sort field formula in the record sort expert as follows:
 
if {?Sort by} = 'Employer' then {dhc_sl_transactions.ST_COPYCUST} else
if {?Sort by} = 'Date' then ToText({dhc_sl_transactions.ST_DATE},"yyyy-MM-dd") else
if {?Sort by} = 'Description' then {dhc_sl_transactions.ST_DESCRIPTION}else
if {?Sort by} = 'Invoice Number' then {dhc_sl_transactions.ST_HEADER_REF}else
if {?Sort by} = 'Amount' then ToText({dhc_sl_transactions.ST_UNALLOCATED},0000000000.00)
 
I now want to add an extra parameter called ?Sort Direction which can either be 'Ascending' or 'Descending' and will perform the above sort in the direction specified.
 
What is the best way to do this.
 
Thanks
IP IP Logged
new2crystal1980
Newbie
Newbie


Joined: 13 May 2010
Online Status: Offline
Posts: 6
Quote new2crystal1980 Replybullet Posted: 14 May 2010 at 2:39am
Also in order to get it to work I had to convert amounts to text so now they sort like this:
 
1.53
123.45
22.45
23678.67
3.00
376544.45
 
Is there anyway around this so it sorts in value order? 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum