Get entities grouped by year
My final solution, by guidance @CG Monroe:

$query = $this-&gt;connection-&gt;select('node_field_data', 'n');
$query-&gt;innerJoin('node__field_date_created', 'fdc', 'fdc.entity_id = n.nid');
$query-&gt;addExpression('count(n.nid)', 'nid_count');
$query-&gt;addExpression('substring(fdc.field_date_created_value, 1, 4)', 'yr');
$query-&gt;condition('n.type', 'my_type');
$query-&gt;condition('n.status', 1);
$query-&gt;groupBy('yr')-&gt;orderBy('yr', 'ASC');
$result = $query-&gt;execute()-&gt;fetchAll();