You could either integrate the COUNT and GROUP BY statements into your existing recordsets, or you could add a new recordset inside of the repeat region and get the count for each row separately by adding an additional WHERE clause to only get the data for that row.