Create a Report of Monthly incidnets - I am new to SQL
Updated: 21 May 2010 | 2 comments
Can anyone help or point me to some examples:
I looked through the default report for helpdesk. Didn't find where I could select a pervious month like: November to get a report.
This is what I would like in the report:
Monthly Incident report;
1 ALL INCIDENTS OPEN THAT MONTH(like Oct 1, 2008 to Oct 31, 2008)
2 ALL INCIDENTS CLOSED THAT MONTH
3. AND HOW MANY OF THE CLOSED INCIDNETS ARE FROM THE PERVIOUS MONTH.
Thanks James
discussion Filed Under:
Comments
All incident within a date range
You will have to create your "startdate" and "enddate" global parameters.
______________________________________________
SELECT
hd1.[workitem_number] as 'Id',
hd1.[workitem_created_on] as 'Create Date',
hd1.[workitem_modified_on] as 'Last Modified',
hd1.[workitem_status_lookup_value] as 'Status',
hd1.[workitem_priority_lookup_value] as 'Priority',
hd1.[workitem_category_tree_value] as 'Category',
hd1.[contact_name] as 'Contact',
hd1.[workitem_title] as 'Title',
hd1.[workitem_comment] as 'Comment'
FROM dbo.HD_workitem_current_view hd1
WHERE hd1.[workitem_created_on] between %startdate% AND %enddate%
ORDER BY 'Id'
___________________________________________
Good luck!
-d
-d
All incidents CLOSED within a date range
Once again, you will need to create your "startdate" and "enddate" as global parameters.
____________________________________
SELECT hd1.[workitem_number] as 'Id',
hd1.[workitem_created_on] as 'Create Date',
hd1.[workitem_modified_on] as 'Last Modified',
datediff(%Time Unit%, hd1.[workitem_created_on], hd1.[workitem_modified_on]) as 'Age(%Time Unit%)',
hd1.[workitem_status_lookup_value] as 'Status',
datediff(%Time Unit%, hd1.[workitem_modified_on], getdate()) as 'Since Last Modified',
hd1.[workitem_priority_lookup_value] as 'Priority',
hd1.[workitem_category_tree_value] as 'Category',
hd1.[workitem_title] as 'Title'
FROM dbo.HD_workitem_current_view hd1
WHERE hd1.[workitem_status_lookup_value] = 'Closed'
AND hd1.[workitem_created_on] between %startdate% AND %enddate%
____________________________________
Good luck!
-d
-d
Would you like to reply?
Login or Register to post your comment.