For Programmers: Free Programming Magazines  


Home > Archive > ASP > December 2006 > Help with Calculation of Multiple Records









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help with Calculation of Multiple Records
pmarisole

2006-12-11, 6:57 pm

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=3Dhppccas;DATA
BAS=
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.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com