I have a case when today is tuesday I have to run a query for a date range consisting of Monday through Sunday the week before. so the where clause is something like this Where invoice_dt between (datepart(d,2,invoice_dt) and (datepart(d,1,invoice_dt)
But I need to make sure it only pulls data from last week. I have tons of information (years) in this table and I don't want to pull more info than the most recent week.
View Complete Post