Each of the 3 columns has 3 possible choices:
Columns headings are:
Code: Select all
SAG AFTRA AEA
Data Choices:
n/a n/a n/a
SAG AFTRA AEA
SAG Eligible AFTRA Eligible AEA EligibleI need to design a query that SHOWS ALL when no selection on a form is made, but can produce any combination otherwise. That is, using checkboxes, except for the n/a, I can pass any combination of the other six choices.
I can't figure out a query that will allow this. I assume that the SQL for each column would be something like:
WHERE (members.SAG = 'sag1' OR members.SAG = 'sagEL')
sag1 and sagEL are the variable names used on the form.
The default should be a SHOW ALL if no selection is passed from the form.
I can't figure out what term to use as a default. Originally, I was using WHERE (members.SAG LIKE 'sag1' OR members.SAG LIKE 'sagEL') and % as the default. When all variables have %, it does show all. When all variables have choices other than %, the data is properly filtered. But, if any one variable is % and the others are something else, it returns a show all instead of filtering on the selected variable(s).
When the form is submitted, any unchecked option is filled by the SQL default, which is %.
Basically, using the variables 'sag1' and 'sagEL', the possible combinations would be:
1. Show all - This works if both 'sag1' and 'sagEL' are LIKE '%'
2. Show SAG only - Does not work if 'sagEL' is LIKE % - it forces a show all
3. Show SAG Eligible only - Does not work if 'sag1' is LIKE % - it forces a show all
4. Show SAG or SAG Eligible - This works if both 'sag1' and 'sagEL' are NOT LIKE %
Can anyone help this newbie??
feyd | fixed formatting to look like intended