---
title: "Rostning och lite utrakning..."
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/68422-rostning-och-lite-utrakning"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "crisse6"
published: "2003-02-16T01:33:51.000Z"
updated: "2003-02-16T02:11:05.000Z"
replies: 2
views: 162
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/68422-rostning-och-lite-utrakning"
---

# Rostning och lite utrakning...

## #1 — crisse6, 2003-02-16T01:33Z

Hej!

Bygger en s k poll... Vill nu ha hjalp med att fa ut line.gif sa den stammer overens med hur manga roster det ar i Ja te x... width:en ska alltsa vara ratt. Sen vill jag ocksa fa ut procent fran varje val, alltsa hur manga procent det ar for Ja te x.

Sa har ser koden ut just nu:

```
<%
strPoll = "SELECT t_answers.*, t_question.* FROM t_answers INNER JOIN t_question ON t_answers.questionID = t_question.ID ORDER BY dt DESC"
strSum = "select sum(votes) AS votes from t_question"

set rs = objConn.execute(strPoll)
set rs2 = objConn.execute(strSum)

If rs.eof then
response.write "No questions!"
else
response.write rs("description")&"<br><br>"
response.write rs("question")&"<br><br>"
Do Until rs.eof
response.write rs("answer")&"&nbsp;<img src=""line.gif"" width="""&rs("counts")/rs2("votes")*100&""" height=""3"">&nbsp;"& FormatPercent(rs2("votes"),1,-1) &"<br>"
rs.movenext
loop
response.write "<br>Antal röster: "&rs2("votes")&""
End IF
%>
```

Permalänk: https://www.webforum.nu/p/68422

## #2 — solbulle, 2003-02-16T02:00Z

```
<%
strPoll = "SELECT t_answers.*, t_question.* FROM t_answers INNER JOIN t_question ON t_answers.questionID = t_question.ID ORDER BY dt DESC"
strSum = "select sum(votes) AS votes from t_question"

set rs = objConn.execute(strPoll)
set rs2 = objConn.execute(strSum)

If rs.eof then
response.write "No questions!"
else
response.write rs("description")&"<br><br>"
response.write rs("question")&"<br><br>"
Do Until rs.eof
<%
proc = rs("counts")/rs2("votes")*100
%>
response.write rs("answer")&" <img src=""line.gif"" width="""& proc &""" height=""3""> "& FormatPercent(rs2("votes"),1,-1) &"<br>"
response.write proc & "<br>%"
rs.movenext
loop
response.write "<br>Antal röster: "&rs2("votes")&""
End IF
%>
```

Permalänk: https://www.webforum.nu/p/951927

## #3 — crisse6, 2003-02-16T02:11Z

Japp!

Permalänk: https://www.webforum.nu/p/951932

---

Tråden på webben: https://www.webforum.nu/amne/asp/68422-rostning-och-lite-utrakning
