I have a question about how to perform a calculation. I'm using Access 2003 in Windows XP.

I have three fields of different measurements, which I'll call A, B, and C. Those numbers get crunched to yield X, Y, and Z, respectively, in a query. No problem so far. What I want to do next is calculate N, but how I do that depends on the value of A/B:

If A/B >30
Then N=(Y+Z)/2

If A/B <10
Then N=(X+Z)/2

If 10<= A/B <=30
Then N=( (X+Y)/2 + Z)/2

Can I make this happen in a query?

I've tried various ways of entering If...Then...ElseIf..., with different combinations of parentheses and brackets to separate terms, but I keep getting an error that says "The expression you entered contains invalid syntax. You may have entered an operand without an operator." After I click OK, my first Then in the statement is highlighted.

I would appreciate any help in getting this calculation to work. I'm still new at Access, so please give step-by-step instructions if you can. Many thanks!