• shawndidy (2/21/2010)


    Hi,

    I need to randomly select questions my database. i used the following query:

    SelectCommand="SELECT Top 10 MIN[QuestionID], [Title], [Answer1], [Answer2], [Answer3], [Answer4], [CorrectAnswer], [QuestionOrder] FROM [Question] WHERE ([QuizID] = @QuizID) GROUP BY Title, ORDER BY NewID()"

    I tried and it keeps saying invalid syntax near Order.

    Drop the comma between Title and ORDER BY.


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]