Sorting is a process of arranging records in a specified order. Performing a find pulls up a found set of records. You've called this "sorting" but from the context, I think you want to find these records.
Manually, or in a script, you can enter find mode and specify:
24...28 in the invoice number field.
Then create a new request and specify 45.
Then perform the find.
You can also perform a find for the range 24...28 as described above, then return to find mode, specify 45 and then use extend found set to include invoice 45 with the others.
Both methods produce the same found set of records and both methods can be scripted.