I have a users table that has a table titled 'DOB', of format DateTime in MSSQL. Now, I would like to filter rows for all users who are over 30. till now i used this code:
SELECT * FROM [User] WHERE [User].DOB > = DATEADD(YEAR, @ageFrom, GetDate())
this statement returns nothing if i input a negative number as ageFrom and returns all rows if it is positive.
Can someone point me to correct direction?