Help with Calculation of Multiple Records

Help with Calculation of Multiple Records

am 07.12.2006 15:21:41 von pmarisole

I need help in calculating a score for each employee based on values
submitted from drop-down boxes
Example:
Emp1 TeamScore(1-10)
Emp2 TeamScore(1-10)
Emp3 TeamScore(1-10)
Emp4 TeamScore(1-10)
Emp5 TeamScore(1-10)

I want to take the values from each drop-down and multiply them by a
weighted score that I get
from another database table (ie 0.11 etc)


I get a Type Mismatch (string) error when I run the following code:
MLevel2 =3D "0"
On Error Resume Next
Set C9 =3D Server.CreateObject("ADODB.Connection")
C9.Open "Provider=3Dsqloledb;Data
Source=3Debs-sqlc1-vs3.edn.runi.com\SSS;UID=3Dcasuser;PWD=3D hppccas;DATABAS=
E=3Dskil=ADls"

Set rsScors=3D Server.CreateObject("ADODB.Recordset")
sSQ5 =3D "Select * from WgtScore where org =3D '" & session("orgg") & "'
AND mgmtlevel =3D '" & MLevel2 & "'"
rsScors.Open sSQ5, C9, adOpenKeySet,adLockReadOnly, adCmdText
D5 =3D rsScors("QDiv5")
SS5 =3D "0.0"
S11 =3D round(rsScors("WS1"),2)
rsScors.close
set rsScors =3D Nothing


strID =3D split(request.form("Emp"), ", ")
QQ1 =3D split(request.form("Q1")* S11,",")
FOR i =3D LBound(strID) TO UBound(strID)
sSQL =3D "UPDATE EAPcurrentyear SET Q1=3D '" & trim(QQ1(i)) & "' where
(empid =3D'" & strID(i) & "')"
C9.Execute(sSQL)
NEXT
C9.Close
Set C9 =3D Nothing=20
%>=20


Any help with this would be Greatly appreciated.