View Poll Results: Was this post easy to understand

Voters
2. You may not vote on this poll
  • Yes

    1 50.00%
  • No

    0 0%
  • Maybe

    0 0%
  • No comment

    1 50.00%
Results 1 to 6 of 6

Thread: [RESOLVED] SQL Server 2000 Query Help returning first attempted record

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Location
    Wonder Lake, IL
    Posts
    38

    Resolved [RESOLVED] SQL Server 2000 Query Help returning first attempted record

    SQL Server 2000.

    I am trying to write a query that obtains the first record submitted by a user. The user can take a test as many times as they want I just need to know how to obtain the first attempt.

    Here is my first attempt and it returns multiple attemps though. A nudge in the correct direction would be greatly appreciated



    SELECT Distinct tbl_security.UserId,
    tbl_security.Username,
    tbl_coursecodes.coursecode,
    tbl_quizresults.surveycode,
    tbl_quizresults.score,
    MIN(tbl_quizresults.startdate)




    FROM

    CPTD.dbo.tbl_coursecodes tbl_coursecodes
    join CPTD.dbo.tbl_surveycodes tbl_surveycodes
    on tbl_coursecodes.coursecode = tbl_surveycodes.coursecode
    join CPTD.dbo.tbl_surveyquizzes tbl_surveyquizzes
    on tbl_surveycodes.rowid = tbl_surveyquizzes.surveycode
    join CPTD.dbo.tbl_quizzes tbl_quizzes
    on tbl_surveyquizzes.quizid = tbl_quizzes.rowid
    join CPTD.dbo.tbl_quizversions tbl_quizversions
    on tbl_quizzes.rowid = tbl_quizversions.quizid
    join CPTD.dbo.tbl_quizresults tbl_quizresults
    on tbl_quizversions.rowid = tbl_quizresults.quizid
    join CPTD.dbo.tbl_security tbl_security
    on tbl_security.rowid = tbl_quizresults.userid


    Where tbl_quizresults.startdate >= '2006-09-01'
    AND tbl_coursecodes.coursecode = 'CSS100012'


    Group By tbl_security.UserId,
    tbl_security.Username,
    tbl_coursecodes.coursecode,
    tbl_quizresults.surveycode,
    tbl_quizresults.score
    Last edited by Hack; Jan 11th, 2007 at 12:15 PM. Reason: Added [RESOLVED] to thread title and green "resolved" checkmark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width