Hi Guys,
I'm quite new to sql. I want to make a query that retrieves al the data from people that are 65 and older. Here's what i've tried so far
select
[Name]
[Cl]
[date_birth]
[EML]
from
[db].[dbo].[table]
WHERE
DATEPART(MONTH, date_birth)=DATEPART(MONTH,DATEADD(YEAR,'[^65]%',getdate()))
AND
DATEPART(YEAR,date_birth)=DATEPART(YEAR,DATEADD(YEAR,'[^65]%',getdate()))
Also tried to add LIKE before '[^65]% but didn't work.
When i just write just -65 i get all the people that are 65 but not older. What's wrong in this query?