Alex wrote:

>I have the SQL statement:
> 
>sql = "SELECT * FROM quest WHERE questID = '" & questID & "' ORDER BY
>questnumber ('3,5,9')"
> 
>In the database, there are several sets of questions (hence the questID
>field), but then I want to just to be able to pick out a selected number (in
>this case 3, 5 and 9)
> 
>The statement and page works with:
>sql = "SELECT * FROM quest WHERE questID = '" & questID & "' ORDER BY
>questnumber ASC"
> 
>What do I need to do to make it work with a specific set of question
>numbers?
>  
>
Don't you just need to extend the Where clause?

sql = "SELECT * FROM quest WHERE questID = '" & questID & "' AND questnumber IN 
('3,5,9') ORDER BY
questnumber ASC"

I think that's the correct syntax for the IN clause, but I can't be sure.

manzo


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to