labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
TicketScore
Parameters
Name
Type
Mode
CID
int
IN
Definition
BEGIN Declare score int; Declare result int; Declare Total int; SELECT 1 as Total,1 as Result, IFNULL(100-Round((((SUM(IF(Status=1 and TimestampDiff(hour,StartedDate,NOW())>TicketNewAgeLimit,1*(TicketNewAgeWeight*.01),0)))+ (SUM(IF(Status=2 and TimestampDiff(hour,StartedDate,NOW())>TicketOpenAgeLimit,1*(TicketOpenWeight*.01),0))))/Count(*))*100),100) as TicketScore from tickets,managementscore Where ClientID=CID into @total,@result,@score; return @score; END