Sorting records
FileMaker Pro stores records in the order they were added to the file. Sorting rearranges records, so you can view, update, or print them in a different sequence.
You choose the fields whose contents you want to sort by. The first sort field arranges the records based on the field's contents. The second sort field arranges records when two or more records have the same value in the first sort field, and so on. You can sort records in ascending order, descending order, or in a custom order.
By default, the records remain sorted until you perform a find or sort records by different criteria. When you add a new record in a sorted found set, or change the data in a sort field of a sorted record, the record appears in the correct position in the sort order when you commit the record.
To sort the records in the current found set:
- In Browse mode, click Sort in the status toolbar.
- In the Sort Records dialog box, choose fields for sorting, in the order you want them sorted.
For details about the sort options in the Sort Records dialog box, see Options for sorting records.
- Click Sort.
To cancel a sort operation before it is finished:
Press Esc (Windows) or Command-period (macOS).
Notes
- Data sorts differently in different field types:
- Automatic record sorting:
- occurs when changes to records are committed
- does not occur while scripts are running or paused
- Records in a sorted portal are re-sorted whenever the relationship is reestablished. (For example, when you browse out of and then back into the record, or change the value in the match field.) See Creating portals to display related records.
- Repeating fields sort by the value in the first repetition. See Defining repeating fields.
- If you import records from another file into a sorted file, the records are not automatically sorted. Instead, the status toolbar shows Semi-sorted. Sort again to incorporate new records in the sort order.
- System formats affect the way numbers, dates, and times sort. See Opening files with different system formats.
- When you define a text field, the default language for indexing and sorting text is determined by the operating system on which FileMaker Pro is running. If you want to override the default language for a sort, select Override field's language for sort in the Sort Records dialog box. To permanently change the field's default language, see Defining field indexing options.
- You can open another window in order to perform different sort requests on the same data. See Opening and managing files.
- If you open a file, sort records, and then close the file, the sort order is not saved. See Saving and copying files.
- You can sort using a "default" language setting or Unicode to have FileMaker Pro ignore language-based sorting rules. See Choosing a language for indexing or sorting.
This field type |
Sorts data in this order |
Text |
Alphabetically. Numbers sort by character position. (Example of an ascending sort: 1, 11, 2.) Numbers sort before letters. Non-alphanumeric values before the first word are ignored (unless you change the sort language to Unicode). |
Number |
Numerically. Non-numeric characters are ignored. |
Date |
Chronologically. |
Time |
Numerically. Times using AM/PM are sorted according to their 24-hour-clock equivalent (for example, 8:00 PM is 20:00). |
Timestamp |
Chronologically. Times using AM/PM are sorted according to their 24-hour-clock equivalent (for example, 8:00 PM is 20:00). |