Hi there,
Need quick help to generate report for total time spent on ticket for particular location.
I need to write a query to find total hours spend on tickets between Jan 01, 2019 to Dec 31, 2019 per location.
I wrote below query but is gives syntax error.
SELECT
users.location AS "Location",
sum(cast(time_spent as float)/60/60) AS "Total IT Support Hours"
FROM users
INNER JOIN tickets ON users.email = tickets.created_by(email)
INNER JOIN ticket_work ON tickets. = ticket_work.ticket_id
WHERE (users.location='FCH') AND (datetime(tickets.created_at) between ('2019-01-01') and ('2019-12-31') )
group by users.location
Please help.
Many Thanks,
Trupti