Skip to Content
Former Member
Feb 21, 2014 at 06:03 PM

using ranges in an "in" expression




Having quite fun trying to search for an answer to a syntax question using "in"... 8^)

I have a report that checks zip code fields (of type character) and assigns a value to what county they're in.

The original list I got was just dumped into the formula and has worked fine in a pinch. After a little research, I see that the zip list is pretty incomplete, so I'm looking to re-code based of postal SCF assumptions. When I try to use ranges, it's telling me it expects a number, currency amount, blah, blah.

(abbreviated code)

if {@Zip} in //Bronx

['10453','10457','10460'] then 'Bronx'

else if {@Zip} in //Queens

['11361','11362'] then 'Queens'

changed to:

if {@Zip} in //Bronx

['10400' - '10499'] then 'Bronx'

else if {@Zip} in //Queens

['11004' - '11005', '11100' - '11199', '11300' - '11499', '11600' - '11699'] then 'Queens'

I'm having a hard time finding the syntax. Tried a bunch of variations. I will also need to use similar code in Record Selection so I suppose the solution can't rely on Basic syntax