Join both the tables using SQL command and display the output on grid.
Join the 2 tables by use of the LEFT JOIN command in SQL.
Kindly post both of your tables structure for further details on JOIN.
lets say from Customer Table I have CustCode, CustName, CustAdd, CustTel. from my OrderList I have CustCode, PONum, ItemName, QTY, Amt.
I want to get all the records that my customer bought. e.i. customer bought 5 items. the other day he bought 10 items. how can i use sql to join two tables to be able to show the record which my customer bought (the 10 items). what should i do. is there any changes to my table structure for this..kindly post your suggestion please...
PONum, ItemName, QTY, Amt.
str = "select [Book File].Author,[Book File].BookTitle,Return,Penalty,[Transaction File].StudentNumber from ([Transaction Table] left join [Book File] on [Transaction Table].AccessionNumber=[Book File].AccessionNumber left join [Student File] on [Transaction Table].StudentNumber=[Student File].StudentNumber where return=1 and penalty<>0 and BorrowDate>='" & Format(dtpDateFrom, vbShortDate) & "' and BorrowDate<='" & Format(dtpDateTo, vbShortDate) & "'"