Jump to content
Sign in to follow this  

reducing found set

Recommended Posts

Here is the preliminary real-life description--the specific logic question is at the bottom: We get "submissions" of soil samples and we perform a variety of tests on them and write results on printouts that are generated when the samples are brought in and i run a "print tests" script. In all but one case, each test has one layout that is printed and taken into the lab for writing results onto. That layout is repeated on the printout for each sample for which the test was ordered. So, the printout will have rows to enter data for many samples all on one page. All of that works perfectly in our current db except for the "but one case" above. In that one case, the "active bacteria" and "active fungi" tests use the same layout [which is lame, but that's how it is]. As a result, this layout prints once for active bacteria and once for active fungi, essentially ordering the same page twice since these two tests are ordered together 99% of the time.

Because there is this 1%, I can't simply tell it to print for one test and not the other. I tried another option where I search for both tests ("=active" will find both) but this just results in the layout being repeated twice for each sample. What I want is a final sheet that has only one row per sample, regardless of whether it has one or both tests associated with it.

Is there a way within this script that I could take this found set (submission==x, test="active") with two records per sample and reduce it so only one of them (either one) is showing? So instead of this:

50 activebacteria

50 activefungi

51 activebacteria

51 activefungi

i get

50 activesomething

51 activesomething

Or is there a better way to address this problem?

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.

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.