Hi, prcalendar is the master table for calendar. This query will give list of base calendar in your system. select * from prcalendar where prname is not null. The resources will be tagged to each calendar.The resource calendar is stored inprj_resources calendar.you can get that by using the query provided by siva at another post.
http://caforums.ca.com/ca/board/message?board.id=CAClarityGeneralDiscussion&message.id=162&query.id=7610#M162
The slices tables ( prj_blb_slicerequests ,prj_blb_slices ) hold the day / week /monthwise records for each individual resource,which is based on their availability that is dependent on their calendar.so if you take an resource which is tagged to that base calendar you can get the workday and non workday. Non workday will have zero hours(Mostly sat / sundays / public holidays(that should bemarked as non work day).Workday will have the available hours (8 or whatever defined in the base calendar) select sum(data.slice) hrs into avail_hrs
from srm_resources s,
(
select s.prj_object_id, s.slice_date, s.slice
from
prj_blb_slicerequests r, prj_blb_slices s
where
r.id = s.slice_request_id and r.request_name = 'DAILYRESOURCEAVAILCURVE'
) data
where s.id=data.prj_object_id and s.unique_name = 'admin'
and slice_date between startdate and enddate
group by s.unique_name Pls have a look at an similar post ..
http://caforums.ca.com/ca/board/message?board.id=CAClarityGeneralDiscussion&thread.id=4384 But to be honest i don't know how to relate the slices directly with the base calendar..... cheers,sundar