Sorting

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
S_Wright
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

Sorting

Post by S_Wright » Thu Jul 15, 2004 5:09 pm

I have run across an issue that I haven^t found a solution to. We have an alphanumeric field that we want to sort alphabetically. When we have the value totally numeric it doesn^t sort it correctly. ____Example: "100", "10100", "102"...____I want the output to be: "100", "102", "10100", so forth and the problem is that this alphanumeric field can be 20 characters long and have alpha characters too, not just the numeric ones. I thought of using the VAL function but that obviously won^t work in this case.____Guidance?

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Sorting

Post by kfleming » Mon Jul 19, 2004 8:25 am

What you could do is to use two sort fields.__The first would be:__IIF(VAL(fieldname)=0,99999999999999999999,val(fieldname))____This will take all of the records that begin with an Alpha and sort them last, and then sort all those that begin with a number as a numeric.____The second sort will be simply the fieldname.____This will put the numbers first followed by the letters.____Kathleen__R&R Support

Post Reply