I'm trying to select tickets that had status that are currently open (ie on Hold, Pending suppliers, In progress) with a specific ticket class ='SR' between 2 dates (1 April 2015 - 30 April 2015).
select * from tkt_table where class = 'SR' and status = 'INPROG' or status = 'PENDING' or status = 'INC'... order date by datereport desc
There are two tables, the one that has ticket information is tkt_table
and the other one has the ticket status history tktStatus_table
. they both have tktid
as key.
How do I get this SQL statement to show me all of the tickets that had the statuses changed between a selected date(1 April - 30April)
Many thanks :)
Table on left is tkt_table and right is tkt_status
You can use the COUNT(DISTINCT status) in the having clause, like this: