labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
PatchScore
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, IF(IFNULL(ROUND(((SUM( NoneMissing ) + ( SUM( Missing1to2 ) * ( PatchMissing12Weight * .01 ) ) + ( SUM( Missing3to5 ) * ( PatchMissing35Weight * .01 ) ) + ( SUM( Missing5 ) * ( PatchMissing6Weight * .01 ) ))/Count(*))*100),0)>0, IFNULL(ROUND(((SUM( NoneMissing ) + ( SUM( Missing1to2 ) * ( PatchMissing12Weight * .01 ) ) + ( SUM( Missing3to5 ) * ( PatchMissing35Weight * .01 ) ) + ( SUM( Missing5 ) * ( PatchMissing6Weight * .01 ) ))/Count(*))*100),0),0) as PatchScore from v_Patch,managementscore where ClientID=CID into @total,@result,@score; return @score; END