Originariamente inviato da techno
be o capito poco potresti farmi un esempio te
io devo estrarre i dati in base ad ordine alfabeticod ei nomi poi tra questi devon ocomparire in rosso gli ultimi 5
ho capito il select ma tu mi metti oder by data_Registrazione desc
non deve comaprire in base alla data di registrazione ma in base alfabetico del nome
poi perchè hai fato:
last5 = last5 & rs(0) & ","
che mi da questo???
vabbeh ok come non detto.. allora..
immagina di avere una tabella Utenti:
codice:
id, nome, data_registrazione
stampiamo sti utenti:
codice:
<%
'get all users
set rsUtenti = conn.execute("select * from Utenti order by Nome asc")
if rsUTenti.eof then
response.write "nun ce stà nessuno su sto sito de m.."
else
'get last 5
dim last5
last5 = "|"
set rs = conn.execute("select top 5 id from Utenti order by data_registrazione desc")
while not rs.eof
last5= last5 & rs(0) & "|"
rs.movenext
wend
set rs=nothing
'print users
while not rsUtenti.eof
if instr(last5, "|" & rsUtenti("id") & "|" ) >0 then
response.write "stampo in rosso"
else
response.write "stampo normale"
end if
rsUtenti.movenext
wend
end if
set rsUtenti = nothing