Answers.Body: <p>You could try this (not tested):</p>
  
  <pre><code>{% set month = craft.request.getParam('month') %}
  {% set year = craft.request.getParam('year')  %}
  
  {% set firstDayOfMonth = now | date_modify('first day of ' ~ month ~ ' ' ~ year ~ ' 00:00:00') %}
  {% set lastDayOfMonth = now | date_modify('last day of ' ~ month ~ ' ' ~ year ~ ' 23:59:59') %}
  
  {% set entries = craft.entries.section('yourSection').postDate('and', '&gt;= ' ~ firstDayOfMonth, '&lt;= ' ~ lastDayOfMonth) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-03T14:35:44.633Z
Answers.Text: Thank you very much Paul, your code worked and taught me something new.
Answers.UserDisplayName: user1070143
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-02T14:58:51.100Z
Answers.LastActivityDate: 2014-10-02T14:58:51.100Z
Answers.UserDisplayName: Paul
Body: <p>I'm taking the month and year from parameters in the url like this...</p>
  
  <pre><code>{% set month = craft.request.getParam('month') %}
  {% set year = craft.request.getParam('year')  %}
  </code></pre>
  
  <p>The url would look like this: ?month=September&amp;Year=2014</p>
  
  <p>... and want to return entries from a specific section where the postDate month and year match those parameters.</p>
  
  <p>Be very grateful for any pointers.</p>
  
  <p>Thanks
  Lee </p>
  
Tags: <postdate>
Title: How to filter entries by month and year?
ThreadText: # How to filter entries by month and year?
  
  (Asked by: username_0 on 2014-10-02)
  
  I'm taking the month and year from parameters in the url like this...
  
  ```
  {% set month = craft.request.getParam('month') %}
  {% set year = craft.request.getParam('year')  %}
  
  ```
  
  The url would look like this: ?month=September&Year=2014
  
  ... and want to return entries from a specific section where the postDate month and year match those parameters.
  
  Be very grateful for any pointers.
  
  Thanks
  Lee
  
  **Tags:** postdate
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-10-02. Score: 8 | Accepted answer
  
  You could try this (not tested):
  
  ```
  {% set month = craft.request.getParam('month') %}
  {% set year = craft.request.getParam('year')  %}
  
  {% set firstDayOfMonth = now | date_modify('first day of ' ~ month ~ ' ' ~ year ~ ' 00:00:00') %}
  {% set lastDayOfMonth = now | date_modify('last day of ' ~ month ~ ' ' ~ year ~ ' 23:59:59') %}
  
  {% set entries = craft.entries.section('yourSection').postDate('and', '>= ' ~ firstDayOfMonth, '<= ' ~ lastDayOfMonth) %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you very much username_1, your code worked and taught me something new.  
  
  ---
  
  