<?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: How to count range of dates? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601171#M209238</link>
    <description>&lt;P&gt;Before you run stats, try observe actual data fields including extracted fields. &amp;nbsp;You would notice that no events were left after "where". &amp;nbsp;In this case, instead of using strptime() directly in where command, eval them into variables. &amp;nbsp;You'll see that the strptime() doesn't give you any value.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;| where strptime('10/1/2021', "%m/%d/%Y") &amp;lt; ASD AND ASD &amp;lt; strptime('5/27/2022', "%m/%d/%Y")&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's because SPL uses double quotes to delimit literal strings; single quote is used to delimit field names. &amp;nbsp;If you change to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where strptime("10/1/2021", "%m/%d/%Y") &amp;lt; ASD AND ASD &amp;lt; strptime("5/27/2022", "%m/%d/%Y")&lt;/LI-CODE&gt;&lt;P&gt;there should be some events. (If your data satisfies the condition, of course.)&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jun 2022 11:16:19 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-06-09T11:16:19Z</dc:date>
    <item>
      <title>How to count range of dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601041#M209201</link>
      <description>&lt;P&gt;hello team&lt;/P&gt;
&lt;P&gt;please i need solution to these question&lt;/P&gt;
&lt;P&gt;i have three column fields, startDate,endDate, ARTstartDate. i want to count the number of ARTstartDate that falls inbetween the two dates (i.e from startDate to endDate)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 15:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601041#M209201</guid>
      <dc:creator>ositaumeozulu</dc:creator>
      <dc:date>2022-06-08T15:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to count range of dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601047#M209204</link>
      <description>&lt;P&gt;Assuming all fields use the format '2022-06-08' (%F, or %Y-%m-%d), it can be as simple as&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval nARTStartDate = strptime(ARTstartDate, "%F")
| where strptime(startDate, "%F") &amp;lt; nARTstartDate AND nARTstartDate &amp;lt; strptime(endDate, "%F")&lt;/LI-CODE&gt;&lt;P&gt;then perform a count.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 15:48:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601047#M209204</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-06-08T15:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to count range of dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601122#M209226</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval ASD = strptime(ARTStartDate, "%m/%d/%Y")&lt;BR /&gt;| where strptime('10/1/2021', "%m/%d/%Y") &amp;lt; ASD AND ASD &amp;lt; strptime('5/27/2022', "%m/%d/%Y")&lt;BR /&gt;| stats count(ASD) as "Tx_new" by FacilityName&lt;/P&gt;&lt;P&gt;i used the above code as directed, still no result, is there a way i can eval the where clause as a separate field so i can run a count on it&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 06:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601122#M209226</guid>
      <dc:creator>ositaumeozulu</dc:creator>
      <dc:date>2022-06-09T06:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to count range of dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601171#M209238</link>
      <description>&lt;P&gt;Before you run stats, try observe actual data fields including extracted fields. &amp;nbsp;You would notice that no events were left after "where". &amp;nbsp;In this case, instead of using strptime() directly in where command, eval them into variables. &amp;nbsp;You'll see that the strptime() doesn't give you any value.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;| where strptime('10/1/2021', "%m/%d/%Y") &amp;lt; ASD AND ASD &amp;lt; strptime('5/27/2022', "%m/%d/%Y")&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's because SPL uses double quotes to delimit literal strings; single quote is used to delimit field names. &amp;nbsp;If you change to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where strptime("10/1/2021", "%m/%d/%Y") &amp;lt; ASD AND ASD &amp;lt; strptime("5/27/2022", "%m/%d/%Y")&lt;/LI-CODE&gt;&lt;P&gt;there should be some events. (If your data satisfies the condition, of course.)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 11:16:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601171#M209238</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-06-09T11:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to count range of dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601243#M209259</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;wow, just wow, many thanks dear. code is working perfectly&lt;/P&gt;&lt;P&gt;i really appreciate&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 18:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-range-of-dates/m-p/601243#M209259</guid>
      <dc:creator>ositaumeozulu</dc:creator>
      <dc:date>2022-06-09T18:44:44Z</dc:date>
    </item>
  </channel>
</rss>

