0

I want to do a query to filter where date > "select the last 10 weekdays from getdate()" so I can get data older than the last 10 "working days" when working day means is not a Saturday or Sunday.

so for example if today is '11 Jun 2022' I want to do a

select * from table where date <= '27 Jun 2022'

I've tried with the datepart(dw, getdate) > 10

but I'm not getting it to work

Baldie47
  • 1,148
  • 5
  • 16
  • 45
  • Does this answer your question? [Add business days to date in SQL without loops](https://stackoverflow.com/questions/5471524/add-business-days-to-date-in-sql-without-loops) – Thom A Jul 11 '22 at 12:21
  • Hello Larnu, yes, this appears to be what I need :) thank you so much! I wasn't aware that it was a more complicated process than just calling a function, thank you! – Baldie47 Jul 11 '22 at 12:58

0 Answers0