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

need to sort with chars first then numerics on a field. how can i do i

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
The fields values are like AS, DF, 1AS,2AS,3AS,4DF.
I need to sort first on AS, DF and then with 1AS and others.

Is there an easiest way to do it without using a sort table from the database?
 
Create a formula, then sort on it:

//@Sort
IF ISNUMERIC(LEFT({Table.Field},1)) THEN 1 ELSE 0

-dave
 
I think you want:

//@Sort
If ISNUMERIC(LEFT({Table.Field},1)) THEN
{Table.Field}
else
"0"+{table.field}

This way the alpahas will come first, and in order as opposed to the above, which wouldn't place them in order without a second sortation.

Don't display this field, just use it for sorting.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top