Jag loste det faste inte riktigt som jag tankt men om det ar nagon som udrar hur sa postar jag sidan ifall nagon anna skulle behova veta nagon gang..
<%
dim sokord1, sokord2, sokord3
sokord1=request.form("sokord1")
sokord2=request.form("sokord2")
sokord3=request.form("sokord3")
set connection=server.createobject("adodb.connection")
connection.open "dsn=cmt1"
stm = "Select Sum(antaltimmar) as resultat From utbildningsprogram where 1=1 "
if sokord1 \<\> "All" then
stm = stm & "and konto = '" & sokord1 & "' "
end if
if sokord2 \<\> "All" then
stm = stm & "and manad = '" & sokord2 & "' "
end if
if sokord3 \<\> "All" then
stm = stm & "and ar = " & sokord3 & " "
end if
set rs = connection.execute(stm)
if isnull(rs("resultat")) then
resultat = 0
else
resultat = round(rs("resultat"))
end if
%>
Account: <%=sokord1%><br>
Month: <%=sokord2%><br>
Year: <%=sokord3%><br>
Training hours: <%=resultat%><BR>
<hr>
<%
rs.close
set connection=nothing
%>
<%
set connection=server.createobject("adodb.connection")
connection.open "dsn=cmt1"
stm = "Select * from utbildningsprogram where 1=1"
if sokord1 \<\> "All" then
stm = stm & "and konto = '" & sokord1 & "' "
end if
if sokord2 \<\> "All" then
stm = stm & "and manad = '" & sokord2 & "' "
end if
if sokord3 \<\> "All" then
stm = stm & "and ar = " & sokord3 & " "
end if
set rs = connection.execute(stm)
do until rs.eof
%>
<table>
<tr>
<td width="90">Anst Nr:</font> <font color="blue"><%=rs("anstnr")%></font></td>
<td width="100">Namn:</font> <font color="blue"><%=rs("fnamn")%></font></td>
<td width="100"></font> <font color="blue"><%=rs("enamn")%></font></td>
<td width="100">Konto:</font> <font color="blue"><%=rs("konto")%></font></td>
<td>Utbildning:</font> <font color="blue"><%=rs("utbildning")%></font></td></tr>
</table>
<table><tr>
<td width="200">Syfte:</font> <font color="blue"><%=rs("syfte")%></font></td>
<td width="100">Typ:</font> <font color="blue"><%=rs("typ")%></font></td>
<td width="250">Trainer</font> <font color="blue"><%=rs("tranare")%></font></td>
</tr>
</table>
<hr>
<%
rs.movenext
loop
rs.close
set connection=nothing
%>