how can we get last week start and end date in sql code example
Example 1: sql last week
select min(date), max(date)
from calendar
where week = datepart(week, getdate() - 7)
and year = datepart(year, getdate() - 7)
Example 2: date sql get the last week count
select * from dt_table where `date` >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)