On 2007 Dec 3, at 13:40, Flora, Charlene wrote:
I have a sorting issue where I need to sort records in this manner
300 total records
1st sort by “Specialty” in alpha [appx. 25 records – the name
fields do not have data and when all records are sorted by the last
name, first name, these appear at the top. Would like these records
alphabetized]
2nd sort by “Last Name” and “First Name” in alpha [of the remaining
275 records – of these records, we do not want to alphabetize the
Specialty field as the print out is a directory]
Thanks
Charlene Flora
If I understand this correctly, Charlene, you have records of 2 types:
Type A: Has name, may or may not have speciality. Example: Johnson,
Kim, Cytology
Type B: No name, does have specialty. Example: [blank], [blank],
Pediatrics
Right now you're doing a sort by (1) name and (2) specialty, so that
"[blank], [blank], Pediatrics" sorts out among the top 25 records,
well ahead of "Johnson, Kim, Cytology". But ideally you'd like
"[blank], [blank], Pediatrics" to sort between "Pearson, Jan,
Surgery" and "Peeples, Kelly, Anesthesiology".
This is a restatement of your question. If I've misunderstood what
you're after, the advice that follows probably won't work.
Create a new calculated field called "Directory Sorter". It will look
like this:
Case (
IsEmpty ( Name Family ); Specialty;
Name Family & " " & Name Personal & " " & Specialty
)
Then use it as the basis of your sort.
You may wonder why I've put those spaces in there. It's to keep, for
example, "Peterson, Dana" from sorting ahead of "Peters, Stacy". If
you omitted the spaces, the sort would be based on "PetersonDana" and
"PetersStacy". But what you WANT is what you'd get if you sorted
separately on the fields "Name Family" and "Name Personal", namely
"Peters" coming out ahead of "Peterson", irrespective of what the
personal name is.