Query BETWEEN formula giving syntax error

Randy

Registered User.
Local time
Today, 14:55
Joined
Aug 2, 2002
Messages
94
This works
IIf([accountnum] Between "60000000" And "60499999","Material","Overhead") AS Assignment

This does not

IIf([accountnum] Between "60000000" And "60499999" OR Between "60510001" and "60809999","Material","Overhead") AS Assignment

Second formula gives me a Missing Operator Syntax Error message. not sure what I am doing wrong.
 
Shot in the dark, but try

IIf([accountnum] Between "60000000" And "60499999" OR [accountnum] Between "60510001" and "60809999","Material","Overhead") AS Assignment
 
You could just use a nested IIf statement and do each true individually. Then set the false part as the same "Overhead".

IIf([accountnum] Between "60000000" And "60499999", "Material, IIf([accountnum] Between "60510001" and "60809999","Material","Overhead")) AS Assignment
 
Last edited:
i am not sure if the IIF function can process Between statement, it will not give error though.
 

Users who are viewing this thread

Back
Top Bottom