Relational DB

Results 1 to 4 of 4

Thread: Relational DB

  1. #1
    Join Date
    Dec 1969

    Default Relational DB

    Hi all,<BR><BR>I am having trouble with relational DB coding. I have a table tblUsers with a field &#039;NameID&#039; and a field &#039;LastName&#039;. I also have another table tblHours in which I store how many hours a certain NameID has worked on a given project. So both tables have the same field "NameID"<BR><BR>How can I combine the two tables. I want to show that Mister "LastName" has worked "SoManyHours". <BR><BR>Thanx for helping me out!<BR><BR>Wilbert

  2. #2
    Eddie Campbell Guest

    Default RE: Relational DB

    Select TblUsers.LastName, TblHours.Hours from TblUsers Inner Join on TblHours.NameId = TblUser.NameId

  3. #3
    Join Date
    Dec 1969

    Default RE: Relational DB

    There could be a better way, however, if you do something like<BR><BR>SELECT * FROM table1 WHERE table1ID = " & table2ID & ";"<BR><BR>if I am understanding the situation correctly I think that can solve your problem. That way you can find the hours worked by the person who has the ID associated with the name. You just have to make sure the ID&#039;s will match.<BR><BR>Michael Fierro

  4. #4
    Scott S Guest

    Default RE: Relational DB

    Try Using an INNER JOIN <BR><BR>SELECT tblUsers.LASTNAME, tblHours.HOURSWORKED FROM tblUsers INNER JOIN tblHours ON tblUsers.NameID = tblHours.NameID<BR><BR>HTH <BR><BR>Scott S

Posting Permissions

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