Skip to main content
Participant
June 28, 2007
Question

recordset help!

  • June 28, 2007
  • 1 reply
  • 289 views
Hi to all! I'm sort of a newbie in databases so I'm facing this problem.
I got these tables in access database :
tblNames ---------------------------- tblDebts
namesID ----------------------------- debtsID
name ---------------------------------- namesID
surname------------------------------- amount

So, the namesID and namesID are related one to many relation.
What I want to do is in my debts dynamic table in dreamweaver to show the debts but instead of the numeric values of namesID column to show actual name and surname from names table. I know this has some stupid and easy solution but you know me the newbie lost in SQL :)
Please anyone can help? It's urgent!!
Thanks in advance !
This topic has been closed for replies.

1 reply

Inspiring
June 28, 2007
Use a join statement, something like this:
SELECT debts.nameID, debts.amount, (whatever the other columns in debts you need are), names.name, names.surname FROM debts JOIN names ON names.ID = debts.nameID
This will join the columns with the same numeric nameID from each table you have to use the advanced dialog when making the sql statement and be sure to define your variable as the proper type that matches db column types( numeric, text, date ect)
Look at these:
http://www.w3schools.com/sql/sql_join.asp

http://msdn2.microsoft.com/en-us/library/bb208854.aspx