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

Sorting fields 2

Status
Not open for further replies.

gmman

Technical User
Feb 14, 2004
26
US
Is there a way to get Crystal to sort fields with letters and numbers.

This is the results that I am getting:

2-B1
2-B10
2-B11
2-B12
2-B13
2-B14
2-B15
2-B16
2-B17
2-B2
2-B3

This is what I want:

2-B1
2-B2
2-B3
2-B10
2-B11
2-B12
2-B13
2-B14
2-B15
2-B16
2-B17

Thanks for any help
 
Well I would like to say that it was bad data but there are a few locations that don't use a rack number. Example: "1-A1" rack "1" row "A" bin "1" , some locations just use row and bin "A1". I was just wondering if there is a way to ignore the ones that don't follow the standard format?
 
Ignore them so they don't show up on the report, or ignore them so that the formula isn't applied to those?

~Brian
 
Just ignore them so that formula does not apply
 
Give this a try:
Code:
stringVar startString := {table.field}; //replace with your field
numberVar hyphenPos;

hyphenPos := instr(startString,"-");

If hyphenPos > 0 then
    ToText(Val(Left(startString,hyphenPos-1)),"00") + Mid(startString,hyphenPos,2) + totext(val(mid(startString,hyphenPos+2)),"00")
Else
    startString;

~Brian
 
That did the trick, no errors!!!! Thanks Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top