SQL dateadd week 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: get week day from date in sql
SELECT TO_CHAR(your_table.date_colunm, 'DAY')
FROM your_table;