jeg er ikke sikker på hvad fejlen egentligt var men jeg spurgte min matematik lærer, som ikk fatter en skid a computer, om hvordan sådan en formel skulle se ud, og han havde så givet mig en forkert formel så det var nok derfor.. jeg smider lige den rigtige kode op:
<%
set sam = server.CreateObject("ADODB.recordset")
sql = "SELECT count(*) as antal FROM vote WHERE status=1"
sam.open sql, MM_db_STRING, 1, 2
set vote1 = server.CreateObject("ADODB.recordset")
sql1 = "SELECT count(*) as antal FROM vote WHERE var=1 AND status=1"
vote1.open sql1, MM_db_STRING, 1, 2
set vote2 = server.CreateObject("ADODB.recordset")
sql2 = "SELECT count(*) as antal FROM vote WHERE var=2 AND status=1"
vote2.open sql2, MM_db_STRING, 1, 2
set vote3 = server.CreateObject("ADODB.recordset")
sql2 = "SELECT count(*) as antal FROM vote WHERE var=3 AND status=1"
vote3.open sql2, MM_db_STRING, 1, 2
set vote4 = server.CreateObject("ADODB.recordset")
sql2 = "SELECT count(*) as antal FROM vote WHERE var=4 AND status=1"
vote4.open sql2, MM_db_STRING, 1, 2
res1 = vote1("antal") / sam("antal") * 100
res2 = vote2("antal") / sam("antal") * 100
res3 = vote3("antal") / sam("antal") * 100
Res4 = vote4("antal") / sam("antal") * 100
%>