/build/static/layout/Breadcrumb_cap_w.png

Work Report

I am trying to create a report that will show me the below information, but am not too familiar with SQL and keep getting errors.  I have tried taking two reports that have things I want and putting them together but just can't get it to show up correctly how I need it.  HELP PLEASE!!!

Ticket ID, Status Date, Title, Notes added to ticket, Time worked on ticket


0 Comments   [ + ] Show comments

Answers (1)

Posted by: aragorn.2003 11 years ago
Red Belt
0

Most of these information is pretty simply. The problem are the notes, cause they can be find in the HD_WORK table and its an 1:n relation, which means one ticket can have multiple work entries. but you can try this script to get a list of all tickets with the related columns.

select t.ID, t.TITLE, s.NAME, t.CREATED, t.MODIFIED, TIMEDIFF(t.MODIFIED, t.CREATED) as TimeDiff,
      (select count(*) from HD_WORK as w where w.HD_TICKET_ID = t.ID) as CountNotes
 from HD_TICKET as t, HD_QUEUE as q, HD_STATUS as s
where t.HD_QUEUE_ID = q.ID
  and t.HD_STATUS_ID = s.ID
  and q.NAME = 'Default Queue'
order by s.NAME, t.ID

Comments:
  • PS. I got only the tickets from the "Default Queue". See where condition "and q.NAME = 'Default Queue'" - aragorn.2003 11 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ