Thnx Optime, ma mi sa che devo postarti il codice completo, forse potrai indicarmi la soluzione migliore
codice:
pos = Request.Form("posizione")
lng = Request.Form("lingua")
trtt = Request.Form("trattamento")
sist = Request.Form("sistemazione")
intEst = Request.Form("interniEsterni")
sport = Request.Form("sportBenessere")
corsi = Request.Form("attivitaCorsi")
call decidi()
Response.write (...tutte le variabili...)
// funzione in fondo alla pagina
public sub decidi()
Dim Qpos, Qtrtt, Qsist, Qlng, QintEst, Qsport, Qcorsi
Dim contr
if pos = "" OR pos = "scegliere" then
Qpos = "0=0"
else
Qpos = "posizione = '"&pos&"'"
contr = 1
end if
if trtt = "Solo Ristorazione" then
Qtrtt = "trattamento = 'Solo Ristorazione'"
contr = 1
elseIf trtt = "Pensione" then
Qtrtt = "(trattamento like '%Pensione Completa%' OR trattamento like '%Mezza Pensione%')"
contr = 1
else
Qtrtt = "0=0"
end if
if sist = "" OR sist = "scegliere" then
Qsist = "0=0"
else
Qsist = "tipoSistemazione = '"&sist&"'"
contr = 1
end if
if lng <> "" then
contr = 1
lng = replace(lng,"'","''")
arrLng = split(lng,",")
for x = 0 to Ubound(arrLng)
if x = 0 then Qlng = "(0=0"
if trim(arrLng(x)) <> "" then
Qlng = Qlng & " AND [lingue parlate] like '%"&arrLng(x)&"%'"
end if
next
Qlng = Qlng & ")"
else
Qlng = "0=0"
end if
if intEst <> "" then
contr = 1
intEst = replace(intEst,"'","''")
arrIntEst = split(intEst,",")
for x = 0 to Ubound(arrIntEst)
if x = 0 then QintEst = "(0=0"
if trim(arrIntEst(x)) <> "" then
QintEst = QintEst & " AND ServiziInterniEsterni like '%"&arrIntEst(x)&"%'"
end if
next
QintEst = QintEst &")"
else
QintEst = "0=0"
end if
if sport <> "" then
contr = 1
sport = replace(sport,"'","''")
arrSport = split(sport,",")
for x = 0 to Ubound(arrSport)
if x = 0 then Qsport = "(0=0"
if trim(arrSport(x)) <> "" then
Qsport = Qsport & " AND sportBenessere like '%"&arrSport(x)&"%'"
end if
next
Qsport = Qsport &")"
else
Qsport = "0=0"
end if
if corsi <> "" then
contr = 1
corsi = replace(corsi,"'","''")
arrCorsi = split(corsi,",")
for x = 0 to Ubound(arrCorsi)
if x = 0 then Qcorsi = "(0=0"
if trim(arrCorsi(x)) <> "" then
Qcorsi = Qcorsi & " AND sportBenessere like '%"&Qcorsi(x)&"%'"
end if
next
Qcorsi = Qcorsi &")"
else
Qcorsi = "0=0"
end if
end sub