Body: <p>I have a list of year from a form field, not in consecutive order. (ES: 2008, 2010, 2012) </p>
  
  <p>I have built an url in this way: <code>q=&amp;year[]=2008&amp;year[]=2010</code> to get all the records of years 2008 and 2010.</p>
  
  <p>I can get the array from url, but was unable to build a query by year on the entries section.</p>
  
  <p>There is a way to query over multiple years?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-26T23:25:27.540Z
Comments.Text: Are you trying to do this from a plugin (PHP) or from a template (Twig)? And are you trying to query a custom date/time field on the entry or by something like postDate?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-27T08:24:27.313Z
Comments.Text: From a twig template. And I'm query the oistDate.
Comments.UserDisplayName: user5439
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-27T16:59:24.720Z
Comments.Text: So from Twig, you want to get all entries where a custom Date/Time field called `oistDate` has year values of 2008 or 2010 or 2012?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-27T17:16:19.883Z
Comments.Text: No sorry, the field is the publication date of the post postDate
Comments.UserDisplayName: user5439
Tags: <querystring>
Title: Query over multiple split years
ThreadText: # Query over multiple split years
  
  (Asked by: username_0 on 2016-07-26)
  
  I have a list of year from a form field, not in consecutive order. (ES: 2008, 2010, 2012)
  
  I have built an url in this way: `q=&year[]=2008&year[]=2010` to get all the records of years 2008 and 2010.
  
  I can get the array from url, but was unable to build a query by year on the entries section.
  
  There is a way to query over multiple years?
  
  **Tags:** querystring
  
  > **Comments:**
  > **username_1**: Are you trying to do this from a plugin (PHP) or from a template (Twig)? And are you trying to query a custom date/time field on the entry or by something like postDate?  
  > **username_0**: From a twig template. And I'm query the oistDate.  
  > **username_1**: So from Twig, you want to get all entries where a custom Date/Time field called `oistDate` has year values of 2008 or 2010 or 2012?  
  > **username_0**: No sorry, the field is the publication date of the post postDate  
  
  ---
  
  ## 0 answers
  
  