Hi,
I have a query that returns results based upon a user's selection of different fields off of a form.
The query works fine except for when I am trying to reference two fields to obtain results greater that [FIELD_1] but less than [FIELD_2].
It works when the Where section of the SQL only contains those two fields:
Between [Forms]![Form_A]![FIELD_1] And [Forms]![Form_A]![FIELD_2]
However...
When I add an IIf statement such as:
Like IIf([Forms]![Form_A]![FIELD_3]<>"xyz","*",Between [Forms]![Form_A]![FIELD_1] And [Forms]![Form_A]![FIELD_2])
I can get the results of the "*" when [FIELD_3] does not equal "xyz", but when it does equal "xyz" and I enter criteria I get no returns.
I must be missing something in the SQL???
Any help would be greatly appreciated.
I have a query that returns results based upon a user's selection of different fields off of a form.
The query works fine except for when I am trying to reference two fields to obtain results greater that [FIELD_1] but less than [FIELD_2].
It works when the Where section of the SQL only contains those two fields:
Between [Forms]![Form_A]![FIELD_1] And [Forms]![Form_A]![FIELD_2]
However...
When I add an IIf statement such as:
Like IIf([Forms]![Form_A]![FIELD_3]<>"xyz","*",Between [Forms]![Form_A]![FIELD_1] And [Forms]![Form_A]![FIELD_2])
I can get the results of the "*" when [FIELD_3] does not equal "xyz", but when it does equal "xyz" and I enter criteria I get no returns.
I must be missing something in the SQL???
Any help would be greatly appreciated.