Answers.Body: <p>You shouldn't need to use string concatenation here:</p>
  
  <pre><code>.eventStartDate('&gt;= ' ~ 2014 ~ '-' ~ 09)
  </code></pre>
  
  <p>If you're hard coding the year and month, just use:</p>
  
  <pre><code>.eventStartDate('&gt;= 2014-09-01')
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-12T17:25:55.987Z
Answers.LastActivityDate: 2014-08-12T17:25:55.987Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>Ahhhhh. I was because before I changed that I was pulling from a segment which was a string. I figured it out though. Ended up with this which works out... </p>
  
  <pre><code>{% set year = craft.request.segment(2) %}
  {% set month = craft.request.segment(3) %}
  {% set firstDayOfMonth = year ~ "-" ~ month ~ "-01" %}
  {% set daysInThisMonth = firstDayOfMonth|date('t') %}
  {% set lastDayOfMonth = year ~ "-" ~ month ~ "-" ~ daysInThisMonth %}
  
  {% paginate craft.entries()
      .limit(7)
      .section('events')
      .eventStartDate('&gt;= ' ~ firstDayOfMonth | date("U"))
      .eventEndDate('&lt;= ' ~ lastDayOfMonth | date("U"))
  as entriesOnPage %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-12T17:32:43.813Z
Answers.LastActivityDate: 2014-08-12T17:32:43.813Z
Answers.UserDisplayName: Matt Green
Body: <p>Why does this work fine</p>
  
  <pre><code>{% paginate craft.entries().limit(7).section('events').eventStartDate('&gt;= ' ~ 2014 ~ '-' ~ 09) as entriesOnPage %}
  </code></pre>
  
  <p>But this does not</p>
  
  <pre><code>{% paginate craft.entries().limit(7).section('events').eventStartDate('&gt;= ' ~ 2014 ~ '-' ~ 09) as entriesOnPage %}
  </code></pre>
  
  <p>I get this <a href="http://d.pr/i/NRvg" rel="nofollow">http://d.pr/i/NRvg</a></p>
  
  <p>I also get errors when simply using '&lt;' so it seems to require only either a less than or equal to or a greater than or equal to operator.</p>
  
  <p>Can someone point to some kind of documentation for what is allowed within the custom field filter -------------> this part ('&lt;= ' ~ 2014 ~ '-' ~ 09)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-12T17:24:23.450Z
Comments.Text: It's entirely possible I'm going blind, but what's the difference between those two queries?  They look identical to me.
Comments.UserDisplayName: Brad Bell
Tags: <datetime>
Title: Custom field filtering
ThreadText: # Custom field filtering
  
  (Asked by: username_0 on 2014-08-12)
  
  Why does this work fine
  
  ```
  {% paginate craft.entries().limit(7).section('events').eventStartDate('>= ' ~ 2014 ~ '-' ~ 09) as entriesOnPage %}
  
  ```
  
  But this does not
  
  ```
  {% paginate craft.entries().limit(7).section('events').eventStartDate('>= ' ~ 2014 ~ '-' ~ 09) as entriesOnPage %}
  
  ```
  
  I get this <http://d.pr/i/NRvg>
  
  I also get errors when simply using '<' so it seems to require only either a less than or equal to or a greater than or equal to operator.
  
  Can someone point to some kind of documentation for what is allowed within the custom field filter -------------> this part ('<= ' ~ 2014 ~ '-' ~ 09)
  
  **Tags:** datetime
  
  > **Comments:**
  > **username_1**: It's entirely possible I'm going blind, but what's the difference between those two queries?  They look identical to me.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-08-12. Score: 1
  
  You shouldn't need to use string concatenation here:
  
  ```
  .eventStartDate('>= ' ~ 2014 ~ '-' ~ 09)
  
  ```
  
  If you're hard coding the year and month, just use:
  
  ```
  .eventStartDate('>= 2014-09-01')
  
  ```
  
  
  ---
  
  ### Answer by username_0 on 2014-08-12. Score: 1
  
  Ahhhhh. I was because before I changed that I was pulling from a segment which was a string. I figured it out though. Ended up with this which works out...
  
  ```
  {% set year = craft.request.segment(2) %}
  {% set month = craft.request.segment(3) %}
  {% set firstDayOfMonth = year ~ "-" ~ month ~ "-01" %}
  {% set daysInThisMonth = firstDayOfMonth|date('t') %}
  {% set lastDayOfMonth = year ~ "-" ~ month ~ "-" ~ daysInThisMonth %}
  
  {% paginate craft.entries()
      .limit(7)
      .section('events')
      .eventStartDate('>= ' ~ firstDayOfMonth | date("U"))
      .eventEndDate('<= ' ~ lastDayOfMonth | date("U"))
  as entriesOnPage %}
  
  ```
  
  
  ---
  
  