You can do it this way:
SELECT NomeCompleto, Telefone FROM tblcliente WHERE MONTH(DataNascimento) = 5
In this case, using MONTH
, We can filter by month.
Similarly, we can then do it using YEAR
, to filter by year, as shown below:
SELECT NomeCompleto, Telefone FROM tblcliente WHERE YEAR(DataNascimento) = '2017'
You can do as follows, to get the expected result:
SELECT NomeCompleto, Telefone FROM tblcliente WHERE DAY(DataNascimento) = '02' AND MONTH(DataNascimento) = '5'
For research and knowledge purposes, you can also filter by period, in case of reports, as follows:
SELECT NomeCompleto, Telefone FROM tblcliente WHERE DataNascimento BETWEEN '2000-01-01' AND '2020-12-31'