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

SQL script help

$
0
0

I'm using Spiceworks helpdesk at a site where we have several sub-tenants under one roof. Our client has asked that I run a daily report showing how much time was spent on each ticket per day, so they can divvy up the costs. I'm trying to run a SQL report made up of bits and bobs of other scripts I've found on here.

The output report shows multiple updates for any given ticket with the time attached, rather than tallying up the time in total for the day.

Could someone have a look and tell me how to tweek it so I can the running total per ticket?

Script:

SELECT(users.first_name||" "||users.last_name)AS"Time/Ticket Assigned to"

,''||ticket_work.ticket_id||''as"Ticket Number"

,(COALESCE(SUM(ticket_work.time_spent),0)/3600)||'h '||(COALESCE(SUM(ticket_work.time_spent),0)%3600/60)||'m'as"Time Spent"

,ticket_work.created_atas"Time Taken On"

,...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



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