Jump to content
Sign in to follow this  
jlazyr

Sorting male female every other one

Recommended Posts

Is there a way to sort my student records so that they alternate male, female.

[ February 06, 2002, 03:31 PM: Message edited by: jlazyr ]

Share this post


Link to post
Share on other sites

Try this idea:

Make a field in the database, lets call it "sortfield".

Find all the males in the database (you need to have a way to identify males and females) and sort them however you want.

In the found set, perform a Replace by serial number, start at 1 and increment by 2 so the males are all the odd numbers.

Perform a find for all the females, sort the records, perform a replace by serial number starting at 2 and incrementing by 2 so they have all the even numbers.

Now sort the database by the sort field. The males and females sound be interleaved with males first.

LIMITATIONS: because this method relies heavily on the Replace command, it could fail in multi-user environment. The method described should work for all records, it may also work for a subset of the records.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.