Hi,
We have a page here that delivers a set of scores from variables shown in the code.
I need to multiply the specified raw score variables by "3".
These raw score variables are being called from a SQL db...
Each Total Score is the result of a composite sum. I need to multiply each Total Score discreetly, by calling the Specific Variable Name as it occurs in this query, and then add it to the Overall Total Score.
I am using this to try to multiply the raw score
query = query & "select (sum(var_raw_score)*3) "
(see line 4 of code below to get the context)
I am doing something wrong.
I would like some help verifiying the correct approach to actually multiplying each score by three, and then adding those adjusted scores to the final total.
I know this is basic, but I am also trying to see if there are other issues with the database. I would like to get some input on my approach.
Thanks, as usual, it was due yesterday, day, day. !!
++ CODE ++
if testID = "XYZ" then
auxscore = 0
query = ""
query = query & "select (sum(var_raw_score)*3) "
'++ original w/o "*3"++ query = query & "select sum(var_raw_score) "
query = query & " from SESSION_SCORE_VARIABLES "
query = query & " where session_ID = '" & sessionID & "'"
query = query & " and (var_name = 'Total Score'"
query = query & " or var_name = 'Total Raw Score Var1'"
query = query & " or var_name = 'Total Raw Score Var2')"
set recset=connectToDB.Execute(query)
if NOT isnull(recset(0)) then
auxscore = auxscore + recset(0)
end if
Set recset=nothing
query = ""
query = query & "select round(sum(round(cast (var_raw_score as FLOAT)/10,1)),0) "
'query = query & "select sum(var_raw_score/10) "
query = query & " from SESSION_SCORE_VARIABLES "
query = query & " where session_ID = '" & sessionID & "'"
query = query & " and (var_name = 'Total Score 4'"
query = query & " or var_name = 'Total Score 5')"
set recset=connectToDB.Execute(query)
if NOT isnull(recset(0)) then
auxscore = auxscore + recset(0)
end if
Set recset=nothing
query = ""
query = query & "update SESSION_SCORE_VARIABLES "
query = query & " set var_raw_score = " & auxscore
query = query & " where session_ID = '" & sessionID & "'"
query = query & " and var_name = 'Overall Total Score'"
set recset=connectToDB.Execute(query)
set recset=nothing
end if
++END CODE++
Should this be in SQL Forum?
Thanks for any help I have tried lots of variations on the live site without much luck.
Bill Fulbright
[email protected]