<?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: Feature layer WHERE clause syntax in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265327#M6929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems that your date field is a number that represents the number of milliseconds since epoch (January 1, 1970) in UTC, so your Where clause has to be in the same format.&amp;nbsp; You can test if this is the case, by using some Epoch converter: &lt;/SPAN&gt;&lt;A href="http://www.epochconverter.com/"&gt;http://www.epochconverter.com/&lt;/A&gt;&lt;SPAN&gt;. Here are some guidelines for writing your Where clause: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000033000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000033000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 May 2012 17:36:04 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2012-05-23T17:36:04Z</dc:date>
    <item>
      <title>Feature layer WHERE clause syntax</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265321#M6923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do you write a WHERE clause in a feature layer when you want to do a string compare? Something like this:&lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;esri:FeatureLayer ID="AllAvailableFeatureLayer" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Url="http://gismaps.pagnet.org/ArcGIS/rest/services/testprojectALLBikeCounts/MapServer/0"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MouseLeftButtonUp="AllAvailableFeatureLayer_MouseLeftButtonUp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SelectionColor="Yellow"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutFields="*"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where="VolunteerAM='Available' and VolunteerPM&amp;lt;&amp;gt;'Available'"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 18:37:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265321#M6923</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2011-02-02T18:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer WHERE clause syntax</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265322#M6924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;At first glance, your code looks good except if your field is a coded domain. In this case you have to use the code value for 'Available'.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 19:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265322#M6924</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-02-02T19:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer WHERE clause syntax</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265323#M6925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;At first glance, your code looks good except if your field is a coded domain. In this case you have to use the code value for 'Available'.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks dbroux. I found this works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;Where="VolunteerAM = 'Available' and VolunteerPM != 'Available'"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 19:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265323#M6925</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2011-02-02T19:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer WHERE clause syntax</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265324#M6926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How can we compare against Date Fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that injecting date comparison statement will depends on the back end Database you're using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my Feature Service I have a column named &lt;/SPAN&gt;&lt;STRONG&gt;datetime &lt;/STRONG&gt;&lt;SPAN&gt;and I want to be able to filter on that column, so I'm using expressions like these but none of them works: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datetime &amp;gt; '2011-01-01' &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datetime &amp;gt; '2011/01/01' &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datetime &amp;gt; 2011-01-01&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datetime &amp;gt; 2011/01/01&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried even: datetime &amp;gt; to_date(2011-01-01,'YYYY-MM-DD') [Our data base is oracle]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any Idea how to make such comparisons [and is there a way to not depend for back end DB for this statement, or at least know know which system we run against from the service metadata ?]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 15:16:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265324#M6926</guid>
      <dc:creator>HamidMokdes</dc:creator>
      <dc:date>2011-09-21T15:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer WHERE clause syntax</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265325#M6927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can try the following: &lt;/SPAN&gt;&lt;A href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/FeatureServer/0/query?objectIds=&amp;amp;where=datetime+%3C%3D+%272011%2F09%2F13+08%3A53%3A38+UTC%27&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;relationParam=&amp;amp;outFields=*&amp;amp;returnGeometry=true&amp;amp;outSR=&amp;amp;returnIdsOnly=false&amp;amp;f=html"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/FeatureServer/0/query?objectIds=&amp;amp;where=datetime+%3C%3D+%272011%2F09%2F13+08%3A53%3A38+UTC%27&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;relationParam=&amp;amp;outFields=*&amp;amp;returnGeometry=true&amp;amp;outSR=&amp;amp;returnIdsOnly=false&amp;amp;f=html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;datetime &amp;lt;= '2011/09/13 08:53:38 UTC'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 17:17:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265325#M6927</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-09-21T17:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer WHERE clause syntax</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265326#M6928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am consuming a secure map service from a vender that has attribute ENT_LST_DT as&amp;nbsp; esriFieldTypeDate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I query objectid 0,1,2,3,4 for ENT_LST_DT I see the values shown as :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ENT_LST_DT: 486345600000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;API_NUM: 04111204350000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ENT_LST_DT: 817689600000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;API_NUM: 04237024880000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ENT_LST_DT: 641433600000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;API_NUM: 04237026310000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ENT_LST_DT: 1333152000000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;API_NUM: 04237204030000 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On my own map services and the map service you mention in this post, the date is returned as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datetime: 2012/05/23 15:17:45 UTC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;----------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I was wondering why would a date display as that weird number, and more importantly, how do I add a whereclause on this featurelayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your suggested syntax does not work in this case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get Unable to complete operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unable to complete Query operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{Do I need to ask the vender about this? Or do you recognise this internal format of an esriFieldTypeDate)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ps. The only difference I see in the rest endpoint is that their date field is shown as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ENT_LST_DT (Type: esriFieldTypeDate, Alias: ENT_LST_DT) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;whereas the earthquake and all my own date fields on my map services has LENGTH : 36&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SPUD_DATE (Type: esriFieldTypeDate, Alias: SPUD_DATE, &lt;/SPAN&gt;&lt;STRONG&gt;Length: 36 &lt;/STRONG&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you assist?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 14:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265326#M6928</guid>
      <dc:creator>AnastasiaAourik</dc:creator>
      <dc:date>2012-05-23T14:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer WHERE clause syntax</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265327#M6929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems that your date field is a number that represents the number of milliseconds since epoch (January 1, 1970) in UTC, so your Where clause has to be in the same format.&amp;nbsp; You can test if this is the case, by using some Epoch converter: &lt;/SPAN&gt;&lt;A href="http://www.epochconverter.com/"&gt;http://www.epochconverter.com/&lt;/A&gt;&lt;SPAN&gt;. Here are some guidelines for writing your Where clause: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000033000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000033000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 17:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/feature-layer-where-clause-syntax/m-p/265327#M6929</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2012-05-23T17:36:04Z</dc:date>
    </item>
  </channel>
</rss>

