on 02-21-2014 6:03 PM
Hi,
CRv14
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
Help.
Thanks,
Matt
Hi Matt,
Try:
if {@Zip} in //Bronx
['10400' TO '10499'] then 'Bronx'
else if {@Zip} in //Queens
['11004' TO '11005', '11100' TO '11199', '11300' TO '11499', '11600' TO '11699'] then 'Queens'
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, my bad, I had tried that, but may have done some other typo that messed it up.
Works like a charm.
Thank you, Abhilash.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.