<?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: Definition Expression on a FeatureLayer in Runtime SDK based on a date field in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-on-a-featurelayer-in-runtime/m-p/257515#M1689</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/33511"&gt;Kerry Halligan&lt;/A&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did some research of this on my end and found that this query seemed to work best for me.&amp;nbsp; The date field in my table is SuperDate and then I compared it to what we would expect the date format to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;qp.setWhere("date(SuperDate) &amp;gt; date('2046-05-05')");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;This would follow the format of how SQLite tables query for date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;More information on how to format a Date query against a SQLite database can be found here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;&lt;A href="https://www.sqlite.org/lang_datefunc.html" title="https://www.sqlite.org/lang_datefunc.html"&gt;SQLite Query Language: Date And Time Functions&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;Does this help?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;&lt;STRONG&gt;EDIT: &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;You may also want to move this discussion to the Android Runtime SDK section of the site.&amp;nbsp; I am not sure on how to do this but maybe power user, &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;​, remembers how to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;Right below the magnifying glass is an option called "Actions".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;If you click that you should see an option to move and from there you can move it to the Runtime SDK for Android section of GeoNet.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jun 2016 12:36:02 GMT</pubDate>
    <dc:creator>AlexanderNohe1</dc:creator>
    <dc:date>2016-06-23T12:36:02Z</dc:date>
    <item>
      <title>Definition Expression on a FeatureLayer in Runtime SDK based on a date field</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-on-a-featurelayer-in-runtime/m-p/257514#M1688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone had success applying a definition expression on a FeatureLayer based on a date field in the Runtime SDK?&amp;nbsp; I am using the Android SDK and have a local geodatabase created via a sync task.&amp;nbsp; I have a FeatureLayer that contains a Date field, and I want to apply a definition expression to only show features between a specific date range.&amp;nbsp; Definition expressions based on other fields are working fine.&amp;nbsp; I am assuming the problem is the formatting of the Where statement.&amp;nbsp; I have tried:&lt;/P&gt;&lt;P&gt;DATE &amp;gt; Datetime('2015-9-24 00:00:00')&lt;/P&gt;&lt;P&gt;DATE &amp;gt; date '2015-9-24 00:00:00'&lt;/P&gt;&lt;P&gt;DATE &amp;gt; '1443128160724'&lt;/P&gt;&lt;P&gt;DATE &amp;gt; date '2015-9-24 00:00:00'&lt;/P&gt;&lt;P&gt;Here is a link to setDefinitionExpression&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/FeatureLayer.html#setDefinitionExpression(java.lang.String)" title="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/FeatureLayer.html#setDefinitionExpression(java.lang.String)"&gt;FeatureLayer | ArcGIS Android 10.2.8 API&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thanks in advance for any suggestions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 22:08:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-on-a-featurelayer-in-runtime/m-p/257514#M1688</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-06-21T22:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Expression on a FeatureLayer in Runtime SDK based on a date field</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-on-a-featurelayer-in-runtime/m-p/257515#M1689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/33511"&gt;Kerry Halligan&lt;/A&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did some research of this on my end and found that this query seemed to work best for me.&amp;nbsp; The date field in my table is SuperDate and then I compared it to what we would expect the date format to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;qp.setWhere("date(SuperDate) &amp;gt; date('2046-05-05')");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;This would follow the format of how SQLite tables query for date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;More information on how to format a Date query against a SQLite database can be found here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;&lt;A href="https://www.sqlite.org/lang_datefunc.html" title="https://www.sqlite.org/lang_datefunc.html"&gt;SQLite Query Language: Date And Time Functions&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;Does this help?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;&lt;STRONG&gt;EDIT: &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;You may also want to move this discussion to the Android Runtime SDK section of the site.&amp;nbsp; I am not sure on how to do this but maybe power user, &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;​, remembers how to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;Right below the magnifying glass is an option called "Actions".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #6a8759;"&gt;If you click that you should see an option to move and from there you can move it to the Runtime SDK for Android section of GeoNet.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 12:36:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-on-a-featurelayer-in-runtime/m-p/257515#M1689</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-06-23T12:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Expression on a FeatureLayer in Runtime SDK based on a date field</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-on-a-featurelayer-in-runtime/m-p/257516#M1690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;That did it!&amp;nbsp; Thanks for your help on this issue.&amp;nbsp; As a note for other users, don't forget to pad month and day to 2 characters.&amp;nbsp; It would be great to see this example added to the &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;Runtime SDK online documentation so that other users have a working example of date queries for FeatureLayer.setDefinitionExpression.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 16:47:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-on-a-featurelayer-in-runtime/m-p/257516#M1690</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-06-23T16:47:40Z</dc:date>
    </item>
  </channel>
</rss>

