Answers.Body: <p>This code works - I double checked. I had a bug further down in my code.</p>
  
  <pre><code>{% set fwd = entry.eventStartDate|date_modify('+30 min')|date('c') %}
  
  {% set upcomingEvents = craft.entries
    .section('schedule')
    .order('eventStartDate asc')
    .eventStartDate('&gt; ' ~ fwd )
    .limit(5)
    .status('live, pending')
  %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-28T21:19:26.597Z
Answers.LastActivityDate: 2017-02-28T21:19:26.597Z
Answers.UserDisplayName: 4midori
Answers.Body: <p>Include an <code>and</code> in the date filter with a comma. When boiled down this is treaded as an array then converted to a SQL statement. </p>
  
  <pre><code>{% set upcomingEvents = craft.entries
    .section('schedule')
    .order('eventStartDate asc')
    .eventStartDate('and', '&gt; ' ~ fwd )
    .limit(5)
    .status('live, pending')
  %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T15:31:13.000Z
Answers.Text: Hmm, that doesn't seem to work. I'm still getting events starting before the value of {fwd}.
Answers.UserDisplayName: 4midori
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T15:32:41.920Z
Answers.Text: Try removing `|date('c')` from `fwd` eventStartDate.
Answers.UserDisplayName: a-am
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T16:58:34.747Z
Answers.Text: Still not working - is there a way to see the full query the Craft is running?
Answers.UserDisplayName: 4midori
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T17:03:12.993Z
Answers.Text: If you have `devMode` turned on you can view in your JS console what craft is doing.
Answers.UserDisplayName: a-am
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T20:40:08.437Z
Answers.Text: Got it - what am I looking for?
Answers.UserDisplayName: 4midori
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T20:41:27.457Z
Answers.Text: It will output a bunch of requests your looking for the SQL query that gives you the entries.
Answers.UserDisplayName: a-am
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T20:43:00.173Z
Answers.Text: Yes - there are tons of queries. I tried filtering on eventStartDate but I get a huge swath of info.
Answers.UserDisplayName: 4midori
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-28T21:17:28.473Z
Answers.Text: Turns out I was displaying the wrong thing. The original code works! Where's the facepalm emoji?
Answers.UserDisplayName: 4midori
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-26T20:27:46.700Z
Answers.LastActivityDate: 2017-02-26T20:27:46.700Z
Answers.UserDisplayName: a-am
Body: <p>I have a bunch of entries with field eventStartDate and eventEndDate.</p>
  
  <p>First I set the date</p>
  
  <pre><code>    {% set fwd = entry.eventStartDate|date_modify('+30 min')|date('c') %}
  </code></pre>
  
  <p>When I output the value of fwd, it is <strong>2017-04-21T08:30:00-05:00</strong> </p>
  
  <p>So that's 4/21/2017 at 8:30 AM</p>
  
  <p>Then I query the channel to get events after that date/time</p>
  
  <pre><code>{% set upcomingEvents = craft.entries
    .section('schedule')
    .order('eventStartDate asc')
    .eventStartDate('&gt; ' ~ fwd )
    .limit(5)
    .status('live, pending')
  %}
  </code></pre>
  
  <p>I get events on 4/21/17 starting at 8:00AM, not what I intended.</p>
  
  <p>Is my syntax wrong?</p>
  
Tags: <entries><datetime><filter>
Title: Trouble getting entries after a certain date
ThreadText: # Trouble getting entries after a certain date
  
  (Asked by: username_0 on 2017-02-24)
  
  I have a bunch of entries with field eventStartDate and eventEndDate.
  
  First I set the date
  
  ```
      {% set fwd = entry.eventStartDate|date_modify('+30 min')|date('c') %}
  
  ```
  
  When I output the value of fwd, it is **2017-04-21T08:30:00-05:00**
  
  So that's 4/21/2017 at 8:30 AM
  
  Then I query the channel to get events after that date/time
  
  ```
  {% set upcomingEvents = craft.entries
    .section('schedule')
    .order('eventStartDate asc')
    .eventStartDate('> ' ~ fwd )
    .limit(5)
    .status('live, pending')
  %}
  
  ```
  
  I get events on 4/21/17 starting at 8:00AM, not what I intended.
  
  Is my syntax wrong?
  
  **Tags:** entries, datetime, filter
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-02-28. Score: 2 | Accepted answer
  
  This code works - I double checked. I had a bug further down in my code.
  
  ```
  {% set fwd = entry.eventStartDate|date_modify('+30 min')|date('c') %}
  
  {% set upcomingEvents = craft.entries
    .section('schedule')
    .order('eventStartDate asc')
    .eventStartDate('> ' ~ fwd )
    .limit(5)
    .status('live, pending')
  %}
  
  ```
  
  
  ---
  
  ### Answer by username_1 on 2017-02-26. Score: 0
  
  Include an `and` in the date filter with a comma. When boiled down this is treaded as an array then converted to a SQL statement.
  
  ```
  {% set upcomingEvents = craft.entries
    .section('schedule')
    .order('eventStartDate asc')
    .eventStartDate('and', '> ' ~ fwd )
    .limit(5)
    .status('live, pending')
  %}
  
  ```
  
  > **Comments:**
  > **username_0**: Hmm, that doesn't seem to work. I'm still getting events starting before the value of {fwd}.  
  > **username_1**: Try removing `|date('c')` from `fwd` eventStartDate.  
  > **username_0**: Still not working - is there a way to see the full query the Craft is running?  
  > **username_1**: If you have `devMode` turned on you can view in your JS console what craft is doing.  
  > **username_0**: Got it - what am I looking for?  
  > **username_1**: It will output a bunch of requests your looking for the SQL query that gives you the entries.  
  > **username_0**: Yes - there are tons of queries. I tried filtering on eventStartDate but I get a huge swath of info.  
  > **username_0**: Turns out I was displaying the wrong thing. The original code works! Where's the facepalm emoji?  
  
  ---
  
  