I have the following situation
Select query with tons of formulas and calculations goes sluggish
I started some optimization, and I am trying to remove as much calculated fields as I can
One field of the query contains info about personal ID code. The first character in the code comes from gender> 1,3,5 for male and 2,4,6 for women
The form that calls the query provides info about gender in a Gender field
If gender is not selected, parameter is 0
If male > 1
If female > 2
For 0 condition, all records should be dispalyed
For 1, only codes that starts with 1,3 or 5
For 2, only records that starts with 2,4,6
I can easily do it using an Expression field, but I would like to simplify the query and remove the calculated field and use a filterin formula in the ID field [CNP]
I tried this, but it doesn't work
Like IIf([Forms]![Cautare_Membru_Frm].[Gender]=0,"*",
IIf([Forms]![Cautare_Membru_Frm].[Gender]=1,("1" & "*") Or ("3" & "*") Or ("5" & "*"),("2" & "*") Or ("4" & "*") Or ("6" & "*"))
What am I doing wrong here?