I would like to list students which added in the table in specific number of days.
@NumberOfDays INT = 15 -- When I list them the added subtraction result must match this result
SELECT S.Name, S.Surname, S.DateAdded
FROM STUDENT S
WHERE (SELECT CAST(GETDATE()-S.DateAdded) = @NumberOfDays)
but this just doesnt work. can anyone help me please?
DATEADDwith a negative increment will deduct so;For anything added in the last 15 days.