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