Code tables in Administration can be sorted in a variety of ways, including a user-defined order. When a code table is sorted based on a user-defined order, a SEQUENCE value should be assigned to each table entry in the SQL table for those codes, so that they always sort correctly. However, in some cases the SEQUENCE value will be 0 for all code table entries, which results in the sort order (defined in the front end of the database) to not work when used in other areas of the program, such as custom reports.
Download and install the latest patch, which contains all fixes from previous patches. If you are running an older version, download and install the latest version and then the patch.
This issue was most likely caused by a problem with the way that code table entries were converted.