Date Range for Category IT Metrics Report - Need Help
I have a report that is detailed below, but I need to add a Date Range to get the correct totals.
SELECT T0.workitem_category_tree_value AS 'Category', COUNT(workitem_category_tree_value) AS 'Number of Incidents' FROM HD_workitem_current_view T0
WHERE ((T0.workitem_category_tree_value LIKE '%CAP%'
OR (T0.workitem_category_tree_value LIKE '%ds%')
OR (T0.workitem_category_tree_value LIKE '%C%')
OR (T0.workitem_category_tree_value LIKE '%C2%')
OR (T0.workitem_category_tree_value LIKE '%Ap%')
OR (T0.workitem_category_tree_value LIKE '%Ac%')
OR (T0.workitem_category_tree_value LIKE '%VPN%')
OR (T0.workitem_category_tree_value LIKE '%P%')
OR (T0.workitem_category_tree_value LIKE '%A%')
OR (T0.workitem_category_tree_value LIKE '%o%')
GROUP BY T0.[workitem_category_tree_value]
I tried to use the article "Modify Reports to Use Date Range" from the site but receive "Conversion failed when converting datetime from character string" errors.
/*SET dateformat ymd
DECLARE @StartDateTime DATETIME,
@EndDateTime DATETIME
SET @StartDateTime = CAST('%StartDateTime%' AS DATETIME)
SET @EndDateTime = CAST('%EndDateTime%' AS DATETIME)*/
SELECT T0.workitem_category_tree_value AS 'Category', COUNT(workitem_category_tree_value) AS 'Number of Incidents' FROM HD_workitem_current_view T0
WHERE ((T0.workitem_category_tree_value LIKE '%CAP%'
OR (T0.workitem_category_tree_value LIKE '%Ds%')
OR (T0.workitem_category_tree_value LIKE '%C%')
OR (T0.workitem_category_tree_value LIKE '%C2%')
AND T0.workitem_created_on BETWEEN '%StartDateTime%' AND '%EndDateTime%'))
GROUP BY T0.[workitem_category_tree_value]
I must be doing something stupid - but I cannot figure it out. Any help is appreciated.
Comments
Try this SQL code: You will
Try this SQL code: You will need to create 2 Global parameters in the Altiris report generator.
Name = Start Date Type = Date/Time Prompt = Yes
Name = End Date Type = Date/Time Prompt = Yes
Here is the SQL code:
I hope this will help you with the data range question.
Matt
Is there a way to get
Is there a way to get the total of the incidents from%xx% and add them up to get a total of the incident from the combined categories??
example....%how to% 50 tickets
%Break-Fix% 50 tickets
Is there a way to add the two categories to get the 100?? This would be good to have for agrand total of all the tickets in a week...confusing?? I know...
I have been trying with SUM??
Would you like to reply?
Login or Register to post your comment.