Jump to content
Sign in to follow this  
Mandu

Flagging the found set

Recommended Posts

I need to set a flag field in each record of a found set to 1; then set the same flag field to 0 in the omitted set. The number of records is around 10000 and growing, and the found set is 10-20 records. What is the quickest way to do this? BTW - most records in the omitted set will already contain flag=0.

It needs to be fast.

(The reason for doing this is that I'm going to tell MS Word to select all records having flag=1 and generate a form letter - Word's ability to select FM records is limited to matching on a constant.)

Share this post


Link to post
Share on other sites

By script you would need to show all records, then loop over all of them to set the field to zero, then perform the find, and then loop over those set the field to 1. But a quicker way would be by calculation field, using If or Case.

Share this post


Link to post
Share on other sites

Yes, provided that your only find criterion is the If condition you state.

Share this post


Link to post
Share on other sites

The danger in flagging a found set this way is in multi-user files. If multiple users have different found sets and each try to flag records, they will walk all over each other's found sets.

-bd

Share this post


Link to post
Share on other sites

The danger in flagging a found set this way is in multi-user files.

Thanks for pointing that out. Even though there will only be one person using these files, I would guess that MS Word counts as a second user. This is obviously not a very good way to pass a set of records to Word's Data Merge manager.

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.