0

I generate a dynamic pdf in which one section relies on a system 'indicator' value for what it actually prints.

The system queries a member table which each member has a Type of 0,1, or 2 (thousands of rows).

At the end of the full query, I need the script to set a variable which is indicative of the whole of results returned by that type field.

For example:

  • if in ANY of the type results returned there are values of 0, 1 AND 2, then set $result = 100;

  • If in ANY of the type results returned, there are only values of 0 and 1, then set $result = 200;

  • if in any of the type results returned, there are only values of 0, set $result = 300;

  • "" there are only values of 1, set $result = 400;

  • "" there are only values of 2, set $result = 500;

any good way to accomplish this?

1 Answer 1

3

You could just do a query like:

SELECT DISTINCT Type FROM Members WHERE ....

Which will return only 1 to 3 rows.

Then it's just a matter of a few ifs.

PS: you are missing the case where you have 0 and 2.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.