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

I have a field that i have to sort

Status
Not open for further replies.

Goha

IS-IT--Management
May 9, 2002
91
US
I have a field that i have to sort by...
Acct_id char(10)
however i have an issue sorting it .
info on the field
10 alphanumeric char field. it has an account number ie
'10 ',
'1001 ',
'1002 ',
'1002A ',
'1003 ',
'1004 ',
'101 ',
'9999999999',
'A000000001'

so far that is what i have been able to get but what i want is the following...

'10 ',
'101 ', <------ this is the issue
'1001 ',
'1002 ',
'1002A ',
'1003 ',
'1004 ',
'9999999999',
'A000000001'

i trimed the trailing spaces and sorted by the folowing formula (@acct_id) ....

if NumericText (Trim ({Invoice_His_Voucher.Acct_Id})) then
ToNumber ( Trim ({Invoice_His_Voucher.Acct_Id}))

any ideas anyone

Thanks alot in advance.....
 
I have time to pass along theory only, gotta catch a train.

Parse the field into 2 fields, then sort on both:

FRM1:
Parse the numeric part

FRM2:
parse the alpha part

Now sort on FRM1 and FRM2

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top