Do one of the following:


Note: The following guidelines work with any alpha-numeric field. The Constituent ID field is used for example purposes.
 


 

     
    • Create a constituent query and filter on the different ranges of constituent ID that have the same number of digits. On the Sort tab, sort by the ID. For example, query on Constituent Information, ID like ?. Then, create another query for Constituent Information, ID like ??, another for ???, etc.


       

    • Export the query in CSV format and open the file in Excel. Sort by the Constituent ID column (BB63566).


       

    • Update or enter constituent ID numbers with leading zeroes so that all have the same number of digits. For example:

      0000001

      0000002

      0000003

      and so on


       

    • Use the ToNumber function in Crystal:


      The ToNumber function in Crystal Reports can convert a non-numeric field, specifically a text field, into a numeric field when you need to perform arithmetic on the field or sort the field in numeric order. For example, you export Constituent ID for sorting or grouping in a report, but discover that because it is an alphanumeric field, it sorts in alphanumeric order instead of numeric order. To sort or group by this field numerically, convert the field using the ToNumber function.

       



      For the ToNumber function to work properly, the field you want to convert must be populated with numbers only. When using this function, you should first test the value with the NumericText function. If NumericText returns the value TRUE, then you can convert it to a number. If you try to convert a value to a number that is not numeric, the formula produces an error in the report.

       



      The following example uses both functions: If the text string, Constituent ID, can be converted to a number, then convert it to a number else, use zero as the value.

       



      If NumericText ({CONSTITUENT.EN_US}) Then ToNumber ({CONSTITUENT.EN_US}) Else 0

       



      With this formula, the Constituent ID field is converted from a text string to a number and may now be used for sorting or grouping in numeric order.