Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Adding Subcategories to this Sql script for reporting

$
0
0

Hey Spiceworks,

We are trying to get this SQL Script to include Sub Categories as well as all of the items we have defined in sub categories and time worked on each ticket. If at all possible could you also include a generic statement in the event we want to see how to add these catgories or time worked. Thanks (Our Script is below for the current report)

SELECT users.first_name as "Assigned To", count(*) as "# Assigned", tickets.category as "Ticket Category",

round((100.00*count(*))/ ((select 1.00*count(*) from tickets as tickets2 where tickets2.created_at=date('now','-7 days')

)),2) as "percent",

round(sum((strftime('%s' ,tickets.closed_at)-strftime('%s' ,tickets.created_at))/3600.00),2) as "Total Time Open(hrs)",

(select round((sum((strftime('%s' ,tickets2.closed_at)-strftime('%s' ,tickets2.created_at))/3600.00))/count(*),2)...


Viewing all articles
Browse latest Browse all 4871


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>