I am trying to get results where a user is of a certain age between two given dates (DOB) is the dob in the database.
I am not getting any results tho, here is my query:
SELECT * FROM dbo.Users
BETWEEN DATEDIFF(YEAR, DobD, 01/01/2000)AND DATEDIFF(YEAR, DobD, 01/01/2050)
The above example is for someone being 30 yrs old between 01/01/2000 and 01/01/2050 and his birthdate on DobD
Help is appreciated