Help with Calculation of Multiple Records

Discussion in 'ASP General' started by pmarisole, Dec 7, 2006.

  1. pmarisole

    pmarisole Guest

    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 = "0"
    On Error Resume Next
    Set C9 = Server.CreateObject("ADODB.Connection")
    C9.Open "Provider=sqloledb;Data
    Source=ebs-sqlc1-vs3.edn.runi.com\SSS;UID=casuser;PWD=hppccas;DATABASE=skilĀ­ls"

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


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


    Any help with this would be Greatly appreciated.
    pmarisole, Dec 7, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke Airig
    Replies:
    0
    Views:
    772
    Luke Airig
    Dec 31, 2003
  2. Dan

    Delete records or update records

    Dan, May 10, 2004, in forum: ASP General
    Replies:
    1
    Views:
    452
    Ray at
    May 10, 2004
  3. Drew
    Replies:
    7
    Views:
    191
    Ray Costanzo [MVP]
    Nov 10, 2004
  4. Replies:
    3
    Views:
    641
    Anthony Jones
    Nov 2, 2006
  5. Replies:
    10
    Views:
    180
    pmarisole
    Dec 12, 2006
Loading...

Share This Page