i have a golf scorecard vb6 app i am developing. underneath is a database consisting of 5 tables. please find an image of the relationships <a href="http://homepage.ntlworld.com/daniel.burt/relationships.jpg">here </a>.
essentially, my query is mainly based upon a couple of tables (others are tied in, but only require data from 2 tables for what i want to do with results)
i have a vb <a href="http://homepage.ntlworld.com/daniel.burt/vb_form.jpg">form </a> which when you select a player's name, it will then perform a search of the database and return every round that the player has played. please find a screenshot of this form. the section i am attempting to populate is the grid at the bottom.
this is my query at present:
sqlStr3 = "SELECT p.PlayerNickName, c.CourseName, r.RoundID, r.RoundDate, r.RoundScore, rh.RoundHoleRoundID, rh.RoundHoleScore, p.PlayerID " & _
"FROM (players p INNER JOIN (courses c INNER JOIN rounds r ON c.CourseID = r.RoundCourseID) ON p.PlayerID = r.RoundPlayerID) INNER JOIN RoundByHole rh ON r.RoundID = rh.RoundHoleRoundID " & _
this returns 18 instances of "roundid" next to the score for each "roundbyhole". i only require 1 instance of this number, and then every hole will appear in the grid aswell.