title: Access SQL - Where multiple dates match
body: <p>I have the following Access table called 'Products'</p>
  
  <pre><code>REF         DATE               DAYS
  12345       26/03/2020         55
  12345       26/03/2020         55
  12345       20/03/2020         50
  12345       30/06/2020        100
  98765       05/02/2020         70
  98765       05/02/2020         70
  98765       10/04/2020         91
  </code></pre>
  
  <p>I need to create an SQL query in Access that gives an output where each unique REF is listed and then a YES/NO column. The result is YES if all of the DATE values are the same date for the records where DAYS is &lt;= 90 days. If any of the dates are different for the records where DAYS &lt;= 90 then the output should be NO.</p>
  
  <p>I'm not interested in any dates where the value of DAYS is greater than 90.</p>
  
  <p>For the above example, the output would be:</p>
  
  <pre><code>REF       SAME_DATE
  12345     No
  98765     Yes
  </code></pre>