Answers.Body: <p>Do I get your question right that the tricky part is to get entries for a certain day in multiple years?</p>
  <p>Is the number of years in question limited? Then you could set up a loop and query the years one after another.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-29T20:02:31.207Z
Answers.LastActivityDate: 2022-11-29T20:02:31.207Z
Answers.UserDisplayName: obs
Body: <p>I have a route setup for Dates and would like to show all entries from that particular Day and Month.</p>
  <p>For example, clicking 29/11/2022 would take you to mysite.com/dates/29-11 and I would like to see all posts with a <code>date</code> field matching 29/11/****.</p>
  <p>From <a href="https://craftcms.com/docs/4.x/date-time-fields.html" rel="nofollow noreferrer">the docs</a>, it doesn't seem like this is possible, as the comparisons include the year; does anyone know of a way to do it?</p>
  <p>In my head it's something like:</p>
  <pre><code>{% set date = craft.app.request.getSegment(2) %}
  {# so date = '29-11' #}
  
  {% set entries = craft.entries().date(['contains', date]).all() %}
  
  OR
  
  {% set entries = craft.entries().search(date).all() %}
  </code></pre>
  
Tags: <datetime>
Title: Use date field to show related posts
ThreadText: # Use date field to show related posts
  
  (Asked by: username_0 on 2022-11-29)
  
  I have a route setup for Dates and would like to show all entries from that particular Day and Month.
  
  For example, clicking 29/11/2022 would take you to mysite.com/dates/29-11 and I would like to see all posts with a `date` field matching 29/11/\*\*\*\*.
  
  From [the docs](https://craftcms.com/docs/4.x/date-time-fields.html), it doesn't seem like this is possible, as the comparisons include the year; does anyone know of a way to do it?
  
  In my head it's something like:
  
  ```
  {% set date = craft.app.request.getSegment(2) %}
  {# so date = '29-11' #}
  
  {% set entries = craft.entries().date(['contains', date]).all() %}
  
  OR
  
  {% set entries = craft.entries().search(date).all() %}
  
  ```
  
  **Tags:** datetime
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-11-29. Score: 1
  
  Do I get your question right that the tricky part is to get entries for a certain day in multiple years?
  
  Is the number of years in question limited? Then you could set up a loop and query the years one after another.
  
  
  ---
  
  