Answers.Body: <p>It's basically the same as <a href="https://craftcms.stackexchange.com/a/27297/5557">Find entries that use a specific block in their Matrix field?</a></p>
  
  <p>You can use the base query and left join your Super Table content row</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% set entries = craft
      .entries()
      .section(['your-section'])
      .leftJoin('{{%supertableblocks}} as supertableblocks', '[[supertableblocks.ownerId]] = [[entries.id]]')
      .leftJoin('{{%stc_content}} as stc_content', '[[stc_content.elementId]] = [[supertableblocks.id]]')
      .andWhere(['&gt;=', 'stc_content.field_date', entry.date|date('atom')]) 
      .groupBy('supertableblocks.ownerId')
      .all()
  %}
  </code></pre>
  
  <p>Note: this is untested, maybe you need certain modifications it should just be some kind of guidance. Please keep in mind to replace your actual table and field names. I just used <code>stc_content</code> as a demonstration as well as <code>stc_content.field_date</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-20T08:57:46.167Z
Answers.Text: great thank you, I had not seen the tables created by the plugin.
  Thanks it works now
Answers.UserDisplayName: Patrick Faramaz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-01T01:24:32.127Z
Answers.Text: I get a SQL error when setting `groupBy` that says it's incompatible with MySql 5.7's `sql_mode=only_full_group_by` setting. Any way to modify to avoid the error?
Answers.UserDisplayName: kmgdev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-17T16:31:11.397Z
Answers.LastActivityDate: 2018-08-17T16:31:11.397Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I have a section with a <a href="https://verbb.io/craft-plugins/super-table/features" rel="nofollow noreferrer">Super Table</a> field, each &quot;row&quot; of which contains a date field. I am looking for a way to query for entries where one of the rows contains a future date.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-18T09:18:56.673Z
Comments.Text: The solution of the previous comment did workout for me, just notice that the blocks should be called like this: stc_XXX field_XXX
Comments.UserDisplayName: HairyMike
Tags: <craft3><plugin-supertable>
Title: Entries query by Super Table field
ThreadText: # Entries query by Super Table field
  
  (Asked by: username_0 on 2018-08-17)
  
  I have a section with a [Super Table](https://verbb.io/craft-plugins/super-table/features) field, each "row" of which contains a date field. I am looking for a way to query for entries where one of the rows contains a future date.
  
  **Tags:** craft3, plugin-supertable
  
  > **Comments:**
  > **username_1**: The solution of the previous comment did workout for me, just notice that the blocks should be called like this: stc_XXX field_XXX  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-08-17. Score: 3 | Accepted answer
  
  It's basically the same as [Find entries that use a specific block in their Matrix field?](https://craftcms.stackexchange.com/a/27297/5557)
  
  You can use the base query and left join your Super Table content row
  
  ```twig
  {% set entries = craft
      .entries()
      .section(['your-section'])
      .leftJoin('{{%supertableblocks}} as supertableblocks', '[[supertableblocks.ownerId]] = [[entries.id]]')
      .leftJoin('{{%stc_content}} as stc_content', '[[stc_content.elementId]] = [[supertableblocks.id]]')
      .andWhere(['>=', 'stc_content.field_date', entry.date|date('atom')]) 
      .groupBy('supertableblocks.ownerId')
      .all()
  %}
  
  ```
  
  Note: this is untested, maybe you need certain modifications it should just be some kind of guidance. Please keep in mind to replace your actual table and field names. I just used `stc_content` as a demonstration as well as `stc_content.field_date`
  
  > **Comments:**
  > **username_0**: great thank you, I had not seen the tables created by the plugin. Thanks it works now  
  > **username_3**: I get a SQL error when setting `groupBy` that says it's incompatible with MySql 5.7's `sql_mode=only_full_group_by` setting. Any way to modify to avoid the error?  
  
  ---
  
  