<?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: Inbox Query using date field in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1575008#M60803</link>
    <description>&lt;P&gt;Thanks David,&lt;/P&gt;&lt;P&gt;This appears to have done the trick.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2025 19:29:36 GMT</pubDate>
    <dc:creator>Slamon</dc:creator>
    <dc:date>2025-01-13T19:29:36Z</dc:date>
    <item>
      <title>Inbox Query using date field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1574952#M60798</link>
      <description>&lt;P&gt;I need some help setting up a query or refining a query for the following logic.&lt;/P&gt;&lt;P&gt;AVO_LASTDATE is the last inspection date&lt;/P&gt;&lt;P&gt;I only want to show inspections where AVO_LASTDATE is greater than or equal to 15 days ago, but not in this month of this year.&lt;/P&gt;&lt;P&gt;For example, if the AVO_LASTDATE is 1/4/2025, I shouldn't see it in the inbox until 2/1/2025.&lt;/P&gt;&lt;P&gt;If AVO_LASTDATE is 1/31/2025, I should see it in the inbox starting 2/15/2025&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Inspections have to be at least 15 days apart but I can't do two in the same month.&amp;nbsp; This is what I have now, but am getting a 400 error.&lt;BR /&gt;&lt;BR /&gt;(CURRENT_DATE - 15 &amp;gt;= AVO_LASTDATE) AND MONTH(AVO_LASTDATE) != MONTH(CURDATE())&lt;BR /&gt;AND YEAR(AVO_LASTDATE = YEAR(CURDATE())&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 17:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1574952#M60798</guid>
      <dc:creator>Slamon</dc:creator>
      <dc:date>2025-01-13T17:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox Query using date field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1575003#M60802</link>
      <description>&lt;P&gt;Your last 15 days logic is backwards, you're mixing &lt;FONT face="courier new,courier"&gt;CURRENT_DATE&lt;/FONT&gt; with &lt;FONT face="courier new,courier"&gt;CURDATE()&lt;/FONT&gt; (not a real function), those &lt;FONT face="courier new,courier"&gt;MONTH&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;YEAR&lt;/FONT&gt; functions won't work and you're testing for inequality with &lt;FONT face="courier new,courier"&gt;!=&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;&amp;lt;&amp;gt;&lt;/FONT&gt;. Putting that all together with some help from &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/use-sql-query-to-get-particular-month-between/m-p/1218290/highlight/true#M78896" target="_self"&gt;this post&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;AVO_LASTDATE&lt;/SPAN&gt; &amp;gt; (CURRENT_DATE - 21) AND extract(month from &lt;SPAN&gt;AVO_LASTDATE&lt;/SPAN&gt;) &amp;lt;&amp;gt; extract(month from CURRENT_DATE) AND extract(year from &lt;SPAN&gt;AVO_LASTDATE&lt;/SPAN&gt;) = extract(year from CURRENT_DATE)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 19:12:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1575003#M60802</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-01-13T19:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox Query using date field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1575008#M60803</link>
      <description>&lt;P&gt;Thanks David,&lt;/P&gt;&lt;P&gt;This appears to have done the trick.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 19:29:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1575008#M60803</guid>
      <dc:creator>Slamon</dc:creator>
      <dc:date>2025-01-13T19:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox Query using date field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1579717#M61001</link>
      <description>&lt;P&gt;I ran into a bit of a snag with the EXTRACT (month....).&amp;nbsp; There are no errors, but the query doesn't return any results.&amp;nbsp; I tested it with EXTRACT (year....) and that is working fine.&amp;nbsp; Any ideas on why it's not liking the month option?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;This version works:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;(ASSETTEAM = 'Eagle Ford') AND (AVO = 'Yes') AND (ROUTE_NUMBER = 'A1-101') AND (CURRENT_DATE - 15 &amp;gt;= AVO_LASTDATE) AND EXTRACT (year from AVO_LASTDATE) &amp;lt;&amp;gt; EXTRACT (year from CURRENT_DATE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This version doesn't:&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;(ASSETTEAM = 'Eagle Ford') AND (AVO = 'Yes') AND (ROUTE_NUMBER = 'A1-101') AND (CURRENT_DATE - 15 &amp;gt;= AVO_LASTDATE) AND EXTRACT (month from AVO_LASTDATE) &amp;lt;&amp;gt; EXTRACT (month from CURRENT_DATE)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Ideally, I'd like to get something along the lines of:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;(ASSETTEAM = 'Eagle Ford') AND (AVO = 'Yes') AND (ROUTE_NUMBER = 'A1-101') AND (CURRENT_DATE - 15 &amp;gt;= AVO_LASTDATE) AND EXTRACT (month from AVO_LASTDATE) &amp;lt;&amp;gt; EXTRACT (month from CURRENT_DATE)&amp;nbsp;AND EXTRACT (year from AVO_LASTDATE) &amp;lt;&amp;gt; EXTRACT (year from CURRENT_DATE)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 20:40:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-using-date-field/m-p/1579717#M61001</guid>
      <dc:creator>Slamon</dc:creator>
      <dc:date>2025-01-28T20:40:43Z</dc:date>
    </item>
  </channel>
</rss>

