title: Select and count uniqe value where gender = X
body: <p>I have a  sql query :</p>
  
  <pre><code>SELECT t1.Nev, 
         Count(t2.Datum) AS Edzes_szam 
  FROM   Adatok t1 
         INNER JOIN (SELECT DISTINCT Kod, 
                                     Datum 
                     FROM   Jelenlet 
                     WHERE  Datum LIKE '" + dtm_year_hkszpp_ym + "%') t2 
                 ON t1.Azon_sima = t2.Kod 
  GROUP  BY t1.Nev 
  </code></pre>
  
  <p>I would like to ask your help to change it for only  <code>gender='X'</code> have to be counted.</p>
  
  <p>This query count for a name how many times was it logged in a selected month.
  I would like to make a filter for gender. How and where i have to take this <code>where gender = 'X'</code>.</p>
  
  <p>I'm using MSOLEDB.</p>