Close popover
Anirvan Das (AnirDas1)
Tata Consultancy Services

Tata Consultancy Services
AnirDas1 Member since 2016 6 posts
Tata Consultancy Services
Posted: October 13, 2018
Last activity: October 14, 2018

How to check Business Calendar holidays using SQL function in Report Definition

We have a requirement to create a report definition that will list all the cases got resolved yesterday considering weekends and business holidays. For example, if the report is being run on Monday then Saturday and Sunday being weekends it will check if Friday is Business holiday or not. If Friday is Holiday as per the business calendar then it will fetch the results for Thursday. Else it will get the results for Friday.

We have an instance of calendar (Data-Admin-Calendar) in our application where Closed days are mentioned. We have also written a SQL function to consider weekends. However we are not sure how to incorporate/check for Business Calendar holidays using the SQL Function.
Given the above scenario please help us on how to check if some particular day is a holiday as per the business calendar using the SQL function.
The DB we are using is PostgreSQL.
Any early help would be highly appreciated.
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.