Weird Sort criteria

R

Rathtap

The dataView has the following columns:
CodeType, Code, Description, Amount, CodeDate

CodeType can have the following
values:'BK','BJ','ZZ','BN','BF','BR','BP','BO','BQ','BI','BH'....

I want records to be displayed in the grid in the order of CodeType I
have listed above. As you can see, ASC or DESC will not work. How can
I do it, either in the SQL or in the code - javacript or C#?
 
A

ashelley

The dataView has the following columns:
CodeType, Code, Description, Amount, CodeDate

CodeType can have the following
values:'BK','BJ','ZZ','BN','BF','BR','BP','BO','BQ','BI','BH'....

I want records to be displayed in the grid in the order of CodeType I
have listed above. As you can see, ASC or DESC will not work. How can
I do it, either in the SQL or in the code - javacript or C#?

You will need to add another field to your underlying dataset and sort
by that column when they choose to sort by the codetype column. The
new column could be numeric values.

ie

bk=0
bj=1
zz=2
bn=3
...

-Adam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top