-
1
- #1
Hello,<br>
<br>
I am trying to write an if then else statement in the query design view. My first field is named result. It is usually a small number with up to 5 decimal places. The second field is called Action Limit. It is also a numerical field with decimal places. The new field, the one containing the expression, is Column J. I want column J to contain text that states whether the result is "greater than the action limit", "less than the sction limit" or, if Result = 0, "not detected" I want to write an expression that says:<br>
<br>
If Result = 0 then Column J is "Not Detected"<br>
<br>
ElseIf Result > Action Limit then Column J is "Greater than Action Limit"<br>
<br>
Else Column J is "Less than Action Limit"<br>
<br>
The final outcome would be a table like this, except many more rows:<br>
<br>
Result Action Limit Column J<br>
7 1.2 Greater than Action Limit<br>
.05 1 Less than Action Limit<br>
0 3 Not Detected<br>
<br>
I haven't written statements for years. I'm not sure about the correct syntax for entering a field. Any help would be excellent.<br>
<br>
Thankyou,<br>
Chuck<br>
<br>
<br>
I am trying to write an if then else statement in the query design view. My first field is named result. It is usually a small number with up to 5 decimal places. The second field is called Action Limit. It is also a numerical field with decimal places. The new field, the one containing the expression, is Column J. I want column J to contain text that states whether the result is "greater than the action limit", "less than the sction limit" or, if Result = 0, "not detected" I want to write an expression that says:<br>
<br>
If Result = 0 then Column J is "Not Detected"<br>
<br>
ElseIf Result > Action Limit then Column J is "Greater than Action Limit"<br>
<br>
Else Column J is "Less than Action Limit"<br>
<br>
The final outcome would be a table like this, except many more rows:<br>
<br>
Result Action Limit Column J<br>
7 1.2 Greater than Action Limit<br>
.05 1 Less than Action Limit<br>
0 3 Not Detected<br>
<br>
I haven't written statements for years. I'm not sure about the correct syntax for entering a field. Any help would be excellent.<br>
<br>
Thankyou,<br>
Chuck<br>
<br>