I am trying to write a querry which selects records from table1 based on a numeric field called group. In the criteria section of the query design screen, under the field "group" I entered the following "IIF([Var] = 0, >0,[VAR])".
The values in the group field are 1,2,3,4 etc...
When running the query, you are prompted for the value of [Var]. If you enter 1, the querry returns all records from table1 where Group = 1. It works fine for Var=2,3,4 and so on.
The problem is if [Var] = 0, you would expect the query to return all records where group > 0, however it does not. The expression ">0" on its own in the criteria section does work and return all records but it does not seem to work in an IIF statement.
Im stuck.
[sig][/sig]
The values in the group field are 1,2,3,4 etc...
When running the query, you are prompted for the value of [Var]. If you enter 1, the querry returns all records from table1 where Group = 1. It works fine for Var=2,3,4 and so on.
The problem is if [Var] = 0, you would expect the query to return all records where group > 0, however it does not. The expression ">0" on its own in the criteria section does work and return all records but it does not seem to work in an IIF statement.
Im stuck.
[sig][/sig]