hi guys, i'm using the expression builder in access 2010 to build an IFF calculation. Basically, I want to assign a value to a new field where field one (bottom) minus field 2 (top) is less than a certain value.
I tried this but I get a syntax error:
IIf([BOTTOM] - [TOP] <= 2 , "<2", IIf([BOTTOM] - [TOP] <= 5 , "<5", IIf([BOTTOM] - [TOP] <= 10 , "<10", IIf([BOTTOM] - [TOP] <= 20 , "<20", IIf( [BOTTOM] - [TOP] <= 30 , "<30", IIf([BOTTOM] - [TOP] <= 50 , "<50", IIf([BOTTOM] - [TOP] >= 50 , "50>") ) ) ) ) ) )
I thought that perhaps the "<" symbols in the <truepart> were causing problems so I tried this as well (changing to a letter):
IIf([BOTTOM] - [TOP] <= 2 , "A", IIf([BOTTOM] - [TOP] <= 5 , "B", IIf([BOTTOM] - [TOP] <= 10 , "C", IIf([BOTTOM] - [TOP] <= 20 , "D", IIf( [BOTTOM] - [TOP] <= 30 , "E", IIf([BOTTOM] - [TOP] <= 50 , "F", IIf([BOTTOM] - [TOP] >= 50 , "G") ) ) ) ) ) )
but still i get a syntax error. I'm sure it's possible to do this query, but i just have my expression formula wrong.....but I don't have a <falsepart> value......does that matter? Any ideas on what I'm doing wrong?