I have a doubt with the following query. Could anyone please help me in finding a solution.
My Query is :
SELECT gu.ID,gu.name, pj.prj_id, pj.prj_nom_imput, pj.prj_code_imput, va.vact_date, count(vact_ressource) As No_of_Units
FROM vplan_activite va
inner join glpi_users gu on va.vact_ressource = gu.ID
inner join plan_tache pt on va.vact_tache = pt.tch_id
inner join plan_projet pj on pt.tch_projet = pj.prj_id
inner join plan_type_demande ptd on pt.tch_demande = ptd.dmd_id
WHERE vact_status = 'R'
name Like 'santhosh'
vact_date between '2011-03-01' and '2010-03-31'
GROUP BY name, prj_code_imput, prj_nom_imput, prj_id, gu.ID
Order by prj_id asc
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
The result is :
ID name prj_id prj_nom_imput prj_code_imput vact_date No_of_Units
111 Santhosh 29 Project x 014EC10467300 3/1/2011 5
111 Santhosh 32 Project y 014EC10158500 3/1/2011 2
111 Santhosh 43 Project xy 014EC11015400 3/1/2011 1
111 Santhosh 60 Project yz 680007 3/2/2011 152
111 Santhosh 78 Project a 085 3/9/2011 10
111 Santhosh 83 Project ab 014EC11520600 3/1/2011 5
111 Santhosh 93 Project bc 999999 3/2/2011 38
111 Santhosh 117 Project b 014EC10521900 3/1/2011 1
111 Santhosh 150 Project ca 014EC11724700 3/1/2011 1
111 Santhosh 161 Project c 014EC11858300 3/1/2011 2
111 Santhosh 162 Project d 014EC11696700 3/23/2011 3
The last column shows the no of
units (1unit = 45 mins and 10 units = 1 day) for the current period in selection booked by the particular resource in the
second column. The 6th Column (Vact_Date) shows the date from which the resource started booking for the current period under
My Requirement is to display a column for each date under current period of selection and count the no
of units for the particular date with respect to the Prj_nom_imput.
Kindly let me know the procedure and code for
this? I will elaborate more if my explanation was not clear.
Thanks in Advance.