I've got a table with a datetime field, and I want to create a Stored Proc that retrieves records 'n' days back using an input parameter. Kind of like this:
input parameter: @tiPastDays INT
declare @dPastDate
@dPastDate = CURRENT_DATE - @tiPastDays
select * from MyTable where tTheDateFieldToAnalyze >= @dPastDate
Mind you I'm dealing with dates only and don't care about the time portion.
tia!
--Michael
input parameter: @tiPastDays INT
declare @dPastDate
@dPastDate = CURRENT_DATE - @tiPastDays
select * from MyTable where tTheDateFieldToAnalyze >= @dPastDate
Mind you I'm dealing with dates only and don't care about the time portion.
tia!
--Michael