Hi all,
Having a few problems with a select statement...
I have a table containing values similar to results from a form and when submitted I want to get all results from the table that aren't in the form...
so far I have everything except how best to do the select statement and was wondering if any of you fanatstic people out there could help me...
Code so far:
<%
For Each x in Request.Form()
userTEAMS = Request.Form(x)
'Response.Write userTEAMS & "
"
userSQL = "SELECT * FROM user_preference s WHERE '"&userTEAMS &"' <> prefTEAM "
Set rsREM = conn.Execute (userSQL)
Do Until rsREM.EOF
remTEAM = rsREM("prefTEAM ")
remTEAM = "<font color=green>" & remTEAM & "</font>"
Response.Write( remTEAM & "
")
rsREM.MoveNext
Loop
Next
%>
This just returns all the records in the table and ignores the form values. Would I need to use a case statement to do this?
For example if the:
form contains team1,team2,tea m3
table contains team1,team2,tea m3,team4,team5
I need to just get the values team4 and team5 from the table.
I know my select statement is whack, just left it there as a guide!
Cheers
Si
Having a few problems with a select statement...
I have a table containing values similar to results from a form and when submitted I want to get all results from the table that aren't in the form...
so far I have everything except how best to do the select statement and was wondering if any of you fanatstic people out there could help me...
Code so far:
<%
For Each x in Request.Form()
userTEAMS = Request.Form(x)
'Response.Write userTEAMS & "
"
userSQL = "SELECT * FROM user_preference s WHERE '"&userTEAMS &"' <> prefTEAM "
Set rsREM = conn.Execute (userSQL)
Do Until rsREM.EOF
remTEAM = rsREM("prefTEAM ")
remTEAM = "<font color=green>" & remTEAM & "</font>"
Response.Write( remTEAM & "
")
rsREM.MoveNext
Loop
Next
%>
This just returns all the records in the table and ignores the form values. Would I need to use a case statement to do this?
For example if the:
form contains team1,team2,tea m3
table contains team1,team2,tea m3,team4,team5
I need to just get the values team4 and team5 from the table.
I know my select statement is whack, just left it there as a guide!
Cheers
Si
Comment