<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Syntax for using InputBox input in a whereclause? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/syntax-for-using-inputbox-input-in-a-whereclause/m-p/30429#M809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Steve,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, you would have to convert them to double prior to using them in the where clause. I can't image a data source that has Area or Distance as a string value. Then the where clause would have to include the values and the field names. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this I think in VB:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
pQueryFilter.WhereClause = "AREA &amp;gt; " &amp;amp; dubArea &amp;amp; " AND DISTANCE &amp;gt; " &amp;amp; dubDistance
&lt;/PRE&gt;&lt;SPAN&gt;or this in C#:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
pQueryFilter.WhereClause = "AREA &amp;gt; " + dubArea + " AND DISTANCE &amp;gt; " + dubDistance;
&lt;/PRE&gt;&lt;SPAN&gt;As for dealing with the user input of the &amp;gt;,&amp;lt;, =, etc. it seems that you could introduce those as separate input boxes.&amp;nbsp; You could insert them much the same way as you do the variables for area and distance. However, personally when you have to use that many input boxes to accomplish a goal it's time to consider using a GUI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:13:12 GMT</pubDate>
    <dc:creator>GregRieck</dc:creator>
    <dc:date>2021-12-10T21:13:12Z</dc:date>
    <item>
      <title>Syntax for using InputBox input in a whereclause?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/syntax-for-using-inputbox-input-in-a-whereclause/m-p/30428#M808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have some code where I want to use an InputBox to allow the user to specify the value used in a whereclause, but after 4 hours of searching I cannot figure out the proper syntax.&amp;nbsp; Obviously I am a beginner.&amp;nbsp; Any assistance would be greatly appreciated! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Inputbox code would be similar to the following: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim strArea As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;strArea = InputBox("Area greater than", "Area", "5000")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim strDistance As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;strDistance = InputBox("Distance greater than", "Distance", "50")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this would be my whereclause:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pQueryFilter As IQueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQueryFilter = New QueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQueryFilter.WhereClause = "AREA&amp;gt; AND DISTANCE&amp;gt;"&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I add the strArea and strDistance to this whereclause?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I need to convert them first to type "double", using something like:&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim dubArea As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dubArea = Convert.ToDouble(strArea)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim dubDistance As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dubDistance = Convert.ToDouble(strDistance)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, how would I then add the dubArea and dubDistance to my whereclause?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What if I also wanted to have the user specify the &amp;gt;,&amp;lt;, =, etc. using separate Inputbox's?&amp;nbsp; How would I also add that to the whereclause.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Aug 2011 18:01:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/syntax-for-using-inputbox-input-in-a-whereclause/m-p/30428#M808</guid>
      <dc:creator>AshleyHayes</dc:creator>
      <dc:date>2011-08-13T18:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for using InputBox input in a whereclause?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/syntax-for-using-inputbox-input-in-a-whereclause/m-p/30429#M809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Steve,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, you would have to convert them to double prior to using them in the where clause. I can't image a data source that has Area or Distance as a string value. Then the where clause would have to include the values and the field names. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this I think in VB:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
pQueryFilter.WhereClause = "AREA &amp;gt; " &amp;amp; dubArea &amp;amp; " AND DISTANCE &amp;gt; " &amp;amp; dubDistance
&lt;/PRE&gt;&lt;SPAN&gt;or this in C#:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
pQueryFilter.WhereClause = "AREA &amp;gt; " + dubArea + " AND DISTANCE &amp;gt; " + dubDistance;
&lt;/PRE&gt;&lt;SPAN&gt;As for dealing with the user input of the &amp;gt;,&amp;lt;, =, etc. it seems that you could introduce those as separate input boxes.&amp;nbsp; You could insert them much the same way as you do the variables for area and distance. However, personally when you have to use that many input boxes to accomplish a goal it's time to consider using a GUI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:13:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/syntax-for-using-inputbox-input-in-a-whereclause/m-p/30429#M809</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2021-12-10T21:13:12Z</dc:date>
    </item>
  </channel>
</rss>

