Skip to main content
Question

What is the Syntax for Tester In Operator when using Sting Values

  • February 17, 2017
  • 6 replies
  • 67 views

Hi All,

I seem to not be able to get the Tester to work using the in operator when trying to use Sting values.

I am trying to turn the ArcGIS definition query expression Workpack IN ("WDS - SP1", "WDS - SP2", "WDS - SP3") into the right syntax to place into the Tester.

Having the () on either side gave me nothing, I had some luck with the right value being "WDS - SP1", "WDS - SP2", "WDS - SP3", however this only returned values for WDS - SP1.

 

Cheers

Matt

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

itay
Supporter
Forum|alt.badge.img+19
  • Supporter
  • February 17, 2017

HI @mgerbz,

Try : WDS - SP1,WDS - SP2,WDS - SP3


Forum|alt.badge.img+7

Hi @mgerbz

 

It works when you don't use the quotes around the test-values:


takashi
Celebrity
  • February 17, 2017

Hi @mgerbz

 

It works when you don't use the quotes around the test-values:

hmm, I'm afraid that it may not work. You need to remove the excess whitespaces following to the commas, but I think the double quotations would be necessary in the question case, since the test-value contains a hyphen which is a special character used to specify a range of value in the In operator use.

 

"String ranges (i.e. a-d) can also be specified. If you want to test for values that contain a hyphen, those values should be enclosed in quotation marks. For example, if x=LL-27, then x In "LL-27","LL-83" would be true. On the other hand, x In LL-27,LL-83 would be false." -- Help on the Tester

 


takashi
Celebrity
  • February 17, 2017

HI @mgerbz,

Try : WDS - SP1,WDS - SP2,WDS - SP3

Yes, the excess whitespaces should be removed, but the double quotations have to be left in this case.

 

"String ranges (i.e. a-d) can also be specified. If you want to test for values that contain a hyphen, those values should be enclosed in quotation marks. For example, if x=LL-27, then x In "LL-27","LL-83" would be true. On the other hand, x In LL-27,LL-83 would be false." -- Help on the Tester

 


itay
Supporter
Forum|alt.badge.img+19
  • Supporter
  • February 17, 2017
Yes, the excess whitespaces should be removed, but the double quotations have to be left in this case.

 

"String ranges (i.e. a-d) can also be specified. If you want to test for values that contain a hyphen, those values should be enclosed in quotation marks. For example, if x=LL-27, then x In "LL-27","LL-83" would be true. On the other hand, x In LL-27,LL-83 would be false." -- Help on the Tester

 

Ha missed that on the hyphens, good catch @takashi !

 


  • Author
  • March 10, 2017

Thanks @takashi it was exactly as you said it. I had to keep the double quotation makes, AND remove all white space outside of the quotation marks (aka, only the comma should exist)