How can I come up with a stored procedure that selects results for past 30 days?
where MONTH(RequestDate) > 6 and DAY(RequestDate) >= 10 and MONTH(Req
Something like this?
CREATE PROC GetSomeHistory @NumDaysPrevious int AS BEGIN SELECT * FROM MyTable WHERE RequestDate BETWEEN DATEADD(dd, -1 * @NumDaysPrevious, getdate()) AND getdate(); END ...... EXEC GetSomeHistory 55;