<?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: Query by date range in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21709#M518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would prefer to use code and not create another field.&amp;nbsp; I'm trying to create a form where the user inputs the date range and the features are then selected.&amp;nbsp; I'm not sure how to grab the date in the string and convert it to a date format to query on it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jun 2011 17:12:04 GMT</pubDate>
    <dc:creator>LeonelTorres</dc:creator>
    <dc:date>2011-06-23T17:12:04Z</dc:date>
    <item>
      <title>Query by date range</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21707#M516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a feature class containing a text field which has the date a feaure was added and the user.&amp;nbsp; The format is "yyyymmdd-UserName".&amp;nbsp; What I would like to be able to do is select features based on a date range using VBA.&amp;nbsp; Any help will be much appreciated it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Leonel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 16:39:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21707#M516</guid>
      <dc:creator>LeonelTorres</dc:creator>
      <dc:date>2011-06-23T16:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Query by date range</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21708#M517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would recommend creating a separate date field and use the field calculator to copy only the part before the dash into it as a date.&amp;nbsp; Then you can query dates with the greater than, less than comparison operators and date function.&amp;nbsp; You then don't have to write any code to do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you must keep the field as is, depending on the database the data is in, in the where clause of a query filter, you can use string functions to recover the date part of the string, convert it to date and use a date comparison syntax supported by your database.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 17:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21708#M517</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-06-23T17:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query by date range</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21709#M518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would prefer to use code and not create another field.&amp;nbsp; I'm trying to create a form where the user inputs the date range and the features are then selected.&amp;nbsp; I'm not sure how to grab the date in the string and convert it to a date format to query on it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 17:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21709#M518</guid>
      <dc:creator>LeonelTorres</dc:creator>
      <dc:date>2011-06-23T17:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Query by date range</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21710#M519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In that case the syntax will be tricky.&amp;nbsp; You will need to see which string functions apply to your database's SQL.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for featureclasses in oracle you can use INSTR to find the position of the dash, SUBSTR to get only the part before the dash, TO_DATE to convert it to date and finally you can do '&amp;lt;', '&amp;gt;' operations with the dates in the where clause.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;it works out to something &lt;/SPAN&gt;&lt;STRONG&gt;similar &lt;/STRONG&gt;&lt;SPAN&gt;to this in Oracle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where =&amp;nbsp;&amp;nbsp; "TO_DATE( SUBSTR(DateUserField,1, INSTR(DateUserField, '-') -1), 'YYYYMMDD') &amp;lt; TO_DATE('23-06-2011', 'DD-MM-YYYY') AND TO_DATE( SUBSTR(DateUserField, INSTR(DateUserField, 1, '-') -1), 'YYYYMMDD') &amp;gt; TO_DATE('22-06-2011', 'DD-MM-YYYY')"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For file geodatabase or shapefile, I don't know if you can do the string functions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 19:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21710#M519</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-06-23T19:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Query by date range</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21711#M520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your help.&amp;nbsp; I will have to find out how to do it in SQL Server.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 13:59:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21711#M520</guid>
      <dc:creator>LeonelTorres</dc:creator>
      <dc:date>2011-06-27T13:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Query by date range</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21712#M521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this exact same situation and need, using SQL Server Express. Were you able to find a way to do what you described here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2020 17:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-by-date-range/m-p/21712#M521</guid>
      <dc:creator>IngridHogle</dc:creator>
      <dc:date>2020-03-09T17:10:52Z</dc:date>
    </item>
  </channel>
</rss>

