labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
OSScore
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(OS like stringsplit(OSBadList,',',1) or OS like stringsplit(OSBadList,',',2) or OS like stringsplit(OSBadList,',',3),1*(OSBadWeight*.01),0)))+(SUM(IF(OS like stringsplit(OSWarningList,',',1) or stringsplit(OSWarningList,',',2) or stringsplit(OSWarningList,',',3),1*(OSWarningWeight*.01),0)))) /((Count(*)*(1*(OSBadWeight*.01)))+(Count(*)*(1*(OSWarningWeight*.01)))))*100),100) as OSScore From Computers,ManagementScore Where Computers.ClientID=CID into @total,@result,@score; return @score; END