I am using the query below
What I am trying to do is get 4 combinations
1) Department + source of Tag+ specific Date
2) Department + Specific Date
3) Source of Tag + Specific Date
4) All records
This query is meeting my 2nd and 3rd condition however if I delete the paramters for 2nd and 3rd 1st combination works fine. But I want all four conditions met in one query
SELECT [Unsafe Act Unsafe Condition].*, [Unsafe Act Unsafe Condition].Department, [Unsafe Act Unsafe Condition].Date, [Unsafe Act Unsafe Condition].[Source Of Tag], [Unsafe Act Unsafe Condition].[Close Date]
FROM [Unsafe Act Unsafe Condition]
WHERE ((([Unsafe Act Unsafe Condition].Department)=[Forms]![frmHighLevelReport]![cboDepartment]) AND (([Unsafe Act Unsafe Condition].Date) Between [Forms]![frmHighLevelReport]![cboStartDate] And [Forms]![frmHighLevelReport]![cboEndDate] Or ([Unsafe Act Unsafe Condition].Date) Between [Forms]![frmHighLevelReport]![cboStartDate] And [Forms]![frmHighLevelReport]![cboEndDate]) AND (([Unsafe Act Unsafe Condition].[Source Of Tag])=[Forms]![frmHighLevelReport]![cboSourceOfTag])) OR ((([Unsafe Act Unsafe Condition].Department)=[Forms]![frmHighLevelReport]![cboDepartment]) AND (([Unsafe Act Unsafe Condition].Date) Between [Forms]![frmHighLevelReport]![cboStartDate] And [Forms]![frmHighLevelReport]![cboEndDate] Or ([Unsafe Act Unsafe Condition].Date) Between [Forms]![frmHighLevelReport]![cboStartDate] And [Forms]![frmHighLevelReport]![cboEndDate])) OR ((([Unsafe Act Unsafe Condition].Date) Between [Forms]![frmHighLevelReport]![cboStartDate] And [Forms]![frmHighLevelReport]![cboEndDate] Or ([Unsafe Act Unsafe Condition].Date) Between [Forms]![frmHighLevelReport]![cboStartDate] And [Forms]![frmHighLevelReport]![cboEndDate]) AND (([Unsafe Act Unsafe Condition].[Source Of Tag])=[Forms]![frmHighLevelReport]![cboSourceOfTag]));