You can translate the question and the replies:

Returning data with a max date (minus 1) for weekdays only

Hi, How do i amend the following code to execute daily but exclude weekends as the load_date will never have a weekend date. table.load_date = (SELECT addday(max(load_date), -1) AS addday FROM table) This code executes fine, but each Monday it will return zero records as its looking for data for Sunday but I need it to return Fridays. Thanks Alan
user
27-06-2022 09:56:31 -0400
code

1 Answer

Hello, There is a similar Community [Q&A](https://community.denodo.com/answers/question/details?questionId=9064u000000L8Z2AAK&title=Passing+case+statement+as+subquery+in+select+statement.) relating to how to exclude weekends using the ADDDAY function. Here is another Community [Q&A](https://community.denodo.com/answers/question/details?questionId=90670000000TQAiAAO&titleCalculating%20working%20day%20difference%20between%20two%20dates.) that give a guide for taking off the weekends and holidays. I would use these Community [Q&A] as a useful reference. Hope this helps!
Denodo Team
28-06-2022 12:59:47 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here