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

Sort last 6 digits/characters of a String Field

Status
Not open for further replies.

Lanie

Programmer
Jan 20, 2000
83
US
Hello,
I need to sort the last six digits / characters of a string field and display the entire field. Right now its sorting as per the following example:
00A063
00A155
00C030
00C204
00L281FMS
00W259

What I need is this sort:
00C030
00A063
00A155
00C204
00L281FMS
00W259

It should ignore the first 3 digits/characters and only sort on the last 6.

I know all you great guru's out there know how to do this. Would someone help me out?

Thanks in advance.



Lanie
laniet@ij.net
etroidl@conaxfl.com


 
create the formula {your_field}[4 to 100]. Then menu Report--> Sort Records--> Pick your formula. Here assummed that the field in no longer then 100.
 
As long as the fourth digit is always a number...

Create this formula and then sort on it, keeping your original field on the canvas.

val(mid({your.field},4) )

My results were a little diffeerent than you have pored though. Is there something in the sort that I'm missing, or is it just a typo?

00C030
00A063
00A155
00C204
00W259
00L281FMS



Mike
 
Thank you very very much. It worked great. I have many reports that would require this type of sort and I'll be using it from now on.

Have a great day!

Lanie
laniet@ij.net
etroidl@conaxfl.com


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top