Skal kun vise de sidste 5 records
Hej, hvordan laver jeg ovenstående???Min kode:
strSQL = "SELECT * FROM Regnskab Where Navn = '" & Replace(Request.Querystring("navn"),"'","''") & "'"
Set rs = Conn.Execute(strSQL)
if rs.EOF or rs.BOF then
Response.Write "<br>" & "<h5 align='center'>Der er ikke modtaget nogle indbetalinger!</h5>"
dato = start
months = Datediff ("m",dato,date)
KONTIGENT = FormatNumber(((months+1)*150),2)
SAML = FormatNumber((KONTIGENT+500),2)
Response.Write "<table align='center' style='font-size:14px;' width='180px'><tr><td>Kontigent:</td><td>-" & KONTIGENT & " Kr.</td></tr>"
Response.Write "<tr><td>Indskud: </td><td>-500,00 Kr.</td></tr>"
Response.Write "<tr><td><b>Samlet:</b></td><td><span>-" & SAML & " Kr.</span></td></tr></table>"
else
Response.Write "<br><table align='center' style='font-size:14px;' width='800px'><tr><td style='font-weight:bold;' width='140px'>Dato:</td><td style='font-weight:bold;' width='150px'>Vedrørende:</td><td style='font-weight:bold;' width='275px'>Bevægelse:</td><td align='right' width='75px' style='font-weight:bold;'>Indskud:</td><td align='right' width='80px' style='font-weight:bold;'>Indtægt:</td><td align='right' width='60px' style='font-weight:bold;'>Udgift:</td></tr><tr><td height='5px'></td></tr></table>"
Do until rs.EOF
IND = FormatNumber(rs("Indskud"),2)
DEB = FormatNumber(rs("Debit"),2)
KRE = FormatNumber(rs("Kredit"),2)
Response.Write "<table align='center' style='font-size:14px;'><tr><td width='140px'>" & rs("Dag") & "/" & rs("Maaned") & "-" & rs("Aar") & "</td>"
Response.Write "<td width='150px'>" & rs("Navn") & "</td><td width='275px'>" & rs("Overskrift") & "</td><td align='right' width='75px'>" & IND & "</td><td align='right' width='75px'>" & DEB & "</td><td align='right' width='75px'>" & KRE & "</td></tr><tr><td colspan='6'><hr style='color: #333333;' /></td></tr>"
rs.movenext
Loop
rs.Close
Set rs = Nothing