Effect of business calendar patterns and exceptions impact the result of business calendar functions

General

Effect of business calendar patterns and exceptions impact the result of business calendar functions

Does creating business calendar patterns and business calendar exception impact the result of business calendar functions. As per my understanding and exploration done so far, I created a business calendar pattern and exception for some date, but I did not found any change in the result of the business calendar function. 

SET SESSION calendar = ISO;

select td_week_begin(date '2014-04-04'); 

Above td_week_begin query returned 2014-03-31 as for ISO calendar Monday is the start day.

I created a business calendar pattern, in which I defined Monday as a non working day.

EXEC DBC.CreateBusinessCalendarPattern('ISO', 'MONDAY', 'OFF', 'Non Work Day'); 

After creating the pattern, I tried executing the below query, it gave me the same result 2014-03-31, even though I marked Monday as a non working day.

select td_week_begin(date '2014-04-04'); 

Similarly I created an exception for 2014-03-31 as non working day, Still the above query resulted same.

I wanted to know how the business calendar functions are related with the working and non working day.

Any help would be higly appreciated.

1 REPLY

Re: Effect of business calendar patterns and exceptions impact the result of business calendar functions

My opinion:

Did you try mentioning it specifically ISO too like, after setting

SET SESSION calendar = ISO;

SELECT TD_WEEK_BEGIN(TIMESTAMP'2012-01-15 12:00:00+02:00','ISO',TIME'05:00:00');

you can try delete your exception too and see. Also make sure that when you execute it is successful :)