Tuesday, March 29, 2016

Query To Extract Team In Clarity

select 
inv.code "Investment ID",
inv.name "Name",
srm2.unique_name "Team Resource ID",
tem.team_uid "Team ID",
tem.prAvailStart "Avail Start",
tem.prAvailFinish "Avail Finish",  
decode(tem.prbooking,15,'Hard',10,'Mixed',5,'Soft') "Booking Status",
'0.00%' "Default Allocation",
decode(tem.prisopen,1,'false',0,'true') "Open for Time-entry",
(select srm.last_name from srm_resources srm where srm.id=tem.prroleid) "Project Role ID",
decode(tem.prresourceid,(select srm1.id from srm_resources srm1 where srm1.user_id=inv.manager_id),'Yes','No') "Is Project Manager"  ,
Sysdate "Extract Date"
from inv_investments inv join odf_ca_project odp
on odp.id=inv.id
join pac_mnt_projects pac
on inv.id=pac.id
join prj_obs_associations aso
on aso.record_id=inv.id
and aso.table_name='SRM_PROJECTS'
join prteam tem
on tem.prprojectid=inv.id
join srm_resources srm2
on SRM2.ID=tem.prresourceid
where 
Inv.code in
(
'Project1')

Happy Coding By Bala