I have 3 combos on a form (budled with- year, quarter and month)that users will use them as filters to run a report.
What I want is to use the OR & AND operators in the query as the record source to generate report based on values selected on the 3 combos. I also have the 3 corresponding columns names in my query.
Any ideas in way forward is appreciated.
This is a snap shot query of what am using:
1st attempt:
Expand|Select|Wrap|Line Numbers
- Select fld_year, fld_qrter, fld_month,
- From Table1
- Where fld_year=[year field from form] OR fld_ qrter =[quarter field from form] OR fld_month=[month field from form];
Expand|Select|Wrap|Line Numbers
- Select fld_year, fld_qrter, fld_month,
- From Table1
- Where iif(isnull([quarter field from form] fld_year=[year field from form],iif(isnull([month field from form]), fld_ qrter =[quarter field from form], fld_month=[month field from form]));
What I want to achieve is:
(1)if only year is selected in the combo box then the query should filter records for year only else
(2)if Year and Quarter selected then display for that quarter in that year only else
(3) if Month is selected then display query results for that month of the year only
Thanks..