using WHERE IN in SQL

W

Wilk Teverbaugh

How can I iterate through the values returned from the following statement?

SQL = "SELECT userID, myUsers, one, two FROM users WHERE userID IN (1,2) "


Thanks
 
R

Ray at

Put them in a recordset and do

<%
Do while not TheRecordset.EOF
Response.Write "The UserID value is " &
TheRecordset.Fields.Item(0).Value
Response.Write "The myUsers value is " &
TheRecordset.Fields.Item(1).Value
Response.Write "The one value is " & TheRecordset.Fields.Item(2).Value
Response.Write "The two value is " & TheRecordset.Fields.Item(3).Value
Response.Write "<br>Okay, on to the next recordset, if there is
one.<hr>"
TheRecordset.MoveNext
Loop
%>

That's one option, anyway.

Ray at home
 
W

Wilk Teverbaugh

Thanks Ray.
Very helpful.



Ray at said:
Put them in a recordset and do

<%
Do while not TheRecordset.EOF
Response.Write "The UserID value is " &
TheRecordset.Fields.Item(0).Value
Response.Write "The myUsers value is " &
TheRecordset.Fields.Item(1).Value
Response.Write "The one value is " & TheRecordset.Fields.Item(2).Value
Response.Write "The two value is " & TheRecordset.Fields.Item(3).Value
Response.Write "<br>Okay, on to the next recordset, if there is
one.<hr>"
TheRecordset.MoveNext
Loop
%>

That's one option, anyway.

Ray at home
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,814
Members
47,358
Latest member
AlexSon

Latest Threads

Top