I'm attempting to view records in a table for prioritizing. Ultimately, I'd like to view data records that are older than 72 hours old. However, I do not want Saturday and Sunday Hours to be calculated in the return.
I started with using datepart like this:
SELECT [Record]
FROM [TableD] D
WHERE DATEPART(w,D.[LastChange]) NOT IN (7,1)
AND D.LastChange <= GETDATE()-3
The problem is, there could be a change on a weekend by someone updating a record or a system update. But for reporting, I do not want to calculate 00:00:00 to 11:59 Saturday or Sunday as part of the 72 hour window. So the above isn't quite what I need and I'm not sure what the best method is to get the return I'm looking for.
Adding additional clarification:
Let's say that I want to pull all the records in a table that have not been updated in 48 hours. Records in this table are supposed to be worked within a window of time and escalation needs to occur on those records that haven't been updated. However, the 48 Hours of Saturday and Sunday do not count. So I would not want a select result of a record that was updated at 7:00pm on Friday as my result when I ran the query Monday morning at 9:00am.