help with wiqlQuery
Hi All,
I am learning wiqlQuery but I have an urgent requirement to get the following info:
Finding SUM(Completed Hours) for a personbetween a date rangefor all projects( or a given project)
Actually we want to derive the utilization of a resource.....
Please help me with the query, its urgent
Ok then .... but using the query if I can get all the revisions/changes of all work items for a given person between a date range .... then I can simply loop and sum up .....
so can anybody help me with this query ........
Also I tried using the object model as below ... but having some problem ..
TeamFoundationServer tfs = GetServer(http://tfsserver:8080);
WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
Project project = store.Projects["VersionControl_Sanjoyan"]; string wiqlQuery = "SELECT [System.ID] FROM WorkItems WHERE [System.AreaPath] = 'VersionControl_Sanjoyan' and [Work Item Type] = 'Task' and [Assigned To]='Sanjoyan'"; WorkItemCollection workitems = project.Store.Query(wiqlQuery); int y=0; for(int i = workitems[0].Revision; i>=1;i--)
{
WorkItem x = store.GetWorkItem(workitems[0].Id, i);
y=y+x.Fields["Completed Hours"];
}
Using this logic I only want to consider only the completed hours within a date range .... which date field I need to consider..............