Im running some reports out of the p6 database, im trying to computer the monthly hours based on a calendar.
So the calendar says 8hrs a day, some months have more working days than others as some have 30 days / 31 days / 5 weeks.
any ideas ?
The Calendar table holds both the global and resource calendars.
In it you will see the hours by day, week, month and year.
The issues is that some of the details about a calendar are store in a field called clndr_data which is a coded field. This coded field contains the calendar's DaysOfWeek, View, and Exceptions i.e. non working / holidays.
If you only need an estimate of the number of working hours for a given month, you could use the day_hr_cnt for a given calendar and multiply it against the number of working days within a given month. Found this at
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SET @StartDate = '2013-01-01'
SET @EndDate = '2013-01-31'
(DATEDIFF(dd, @StartDate, @EndDate) + 1)
-(DATEDIFF(wk, @StartDate, @EndDate) * 2)
-(CASE WHEN DATENAME(dw, @StartDate) = 'Sunday' THEN 1 ELSE 0 END)
-(CASE WHEN DATENAME(dw, @EndDate) = 'Saturday' THEN 1 ELSE 0 END)