Query BETWEEN formula giving syntax error (1 Viewer)

Randy

Registered User.
Local time
Today, 09:11
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:11
Joined
Aug 30, 2003
Messages
36,140
Shot in the dark, but try

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

BitsOfBytes

Registered User.
Local time
Today, 09:11
Joined
Apr 14, 2015
Messages
15
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:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:11
Joined
May 7, 2009
Messages
19,249
i am not sure if the IIF function can process Between statement, it will not give error though.
 

Users who are viewing this thread

Top Bottom