Do you mean the entire previous week through today?Or for 1 day a week ago?This would be inclusive of all day starting 1 week ago to midnight tonight:where <DateColumn> >= dateadd(day, datediff(day, 0, getdate()-7), 0) --starting one week ago at 00:00:00.000and <DateColumn < dateadd(day, datediff(day, 0, getdate()+1), 0) --before 12:00 AM tomorrow morning (all day today)--see the valuesselect dateadd(day, datediff(day, 0, getdate()-7), 0) --one week ago at 00:00:00.000select dateadd(day, datediff(day, 0, getdate()+1), 0) --befor 12:00 tomorrow morning
Be One with the OptimizerTG