Do one of the following:


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

 


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

       

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

       

    • Update or enter gift 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 Gift 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, Gift ID, can be converted to a number, then convert it to a number else, use zero as the value.

       



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

       



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