Count of working day

Teradata Studio
Enthusiast

Count of working day

Hi All,

 

I need to count working day excluding saturday and sunday.

For e.g. There are 5 working days between 17-April-2017 to 21-April-2017.

 

Now if I run report on 20-April-2017, I should get my count as 4 (counting from 17th April as 1 and so on...) while on 21-April-2017 the count should be 5.

 

Let me know if you need more details !

1 REPLY
Enthusiast

Re: Count of working day

Hi Guys, I've got the solution for above query though I'm stuck with another scenario. I'll post it in a different post altogether.

Solution for above query will be 

 

Select
(weekday_of_month -1)*5 + ( day_of_week -1) as business_day_of_the_month_count

from sys_calendar.calendar
where calendar_date = date;