fishbone34
06-09-2005, 11:03 PM
Hello everybody, I'm writing a ASP page that pulls data from a database.
I have a column that contains a number value between 0.00 and 100.00.
I need to give a score (1-5) based off of the value above.
Example:
anything <= 9.00 would be a "5"
Anything from 9.01 and 10.00 would be a "4"
Anything from 10.01 and 11.00 would be a "3"
Anything from 11.01 and 12.00 would be a "3"
Anything >= 12.01 would be a "1"
Any help would be wonderful!
This is what I have so far...
'Get Data From M_PhoneSQL
query3 = "Select totalaht FROM m_phonesql where logid = '"&Phone_Id&"' AND DATED = '"&mphonesqldate&"'"
set objRS=Conn.execute(query3)
totalaht = objRS("totalaht")
if totalaht <= 9.00 then
totalaht2 = "5"
end if
if totalaht in [9.01 to 10.00] then
totalaht2 = "4"
end if
if totalaht in [10.01 to 11.00] then
totalaht2 = "3"
end if
if totalaht in [11.01 to 12.00] then
totalaht2 = "2"
end if
if totalaht > 12.00 then
totalaht2 = "1"
end if
I have a column that contains a number value between 0.00 and 100.00.
I need to give a score (1-5) based off of the value above.
Example:
anything <= 9.00 would be a "5"
Anything from 9.01 and 10.00 would be a "4"
Anything from 10.01 and 11.00 would be a "3"
Anything from 11.01 and 12.00 would be a "3"
Anything >= 12.01 would be a "1"
Any help would be wonderful!
This is what I have so far...
'Get Data From M_PhoneSQL
query3 = "Select totalaht FROM m_phonesql where logid = '"&Phone_Id&"' AND DATED = '"&mphonesqldate&"'"
set objRS=Conn.execute(query3)
totalaht = objRS("totalaht")
if totalaht <= 9.00 then
totalaht2 = "5"
end if
if totalaht in [9.01 to 10.00] then
totalaht2 = "4"
end if
if totalaht in [10.01 to 11.00] then
totalaht2 = "3"
end if
if totalaht in [11.01 to 12.00] then
totalaht2 = "2"
end if
if totalaht > 12.00 then
totalaht2 = "1"
end if