Remove the JOIN clause
sql = "Select tblproduct.storeid, tblproduct.code"
sql = sql & ", tblproduct.thumb, tblproduct.caption, tblproduct.id"
sql = sql & ", tblproduct.mpn, tblproduct.upc, tblMisc.code"
sql = sql & ", tblMisc.id from tblMisc, tblProduct where tblProduct.id = " & id
This will return a cross product of every item in each table with the match of tblProduct.id = x.
I doubt this is what you want. You obviously are looking for some kind of relationship between the tables.
If the first, didn't work, then maybe you want this...
sql = "Select tblproduct.storeid, tblproduct.code"
sql = sql & ", tblproduct.thumb, tblproduct.caption, tblproduct.id"
sql = sql & ", tblproduct.mpn, tblproduct.upc, tblMisc.code"
sql = sql & ", tblMisc.id from tblMisc OUTER JOIN tblProduct ON"
sql = sql & " tblMisc.id = tblProduct.id where tblProduct.id = " & id
Hard to tell, as your query is less than precise.
--
Randy Charles Morin
http://www.kbcafe.com
Feel free to contact me by private email or messenger
Quote:
> I am trying to join 2 tables and then display all the results. What
> is happening is that I am only getting back the results that have a
> relationship. I need to display every record of each table together.
> Anyone know how to do this. My sql statement is below:
> sql = "Select tblproduct.storeid, tblproduct.code"
> sql = sql & ", tblproduct.thumb, tblproduct.caption, tblproduct.id"
> sql = sql & ", tblproduct.mpn, tblproduct.upc, tblMisc.code"
> sql = sql & ", tblMisc.id from tblMisc INNER JOIN tblProduct ON"
> sql = sql & " tblMisc.id = tblProduct.id where tblProduct.id = " & id
> Thanks in advance..
> Wayne