Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Query to join tables
Message
 
To
20/07/2000 00:38:38
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00394741
Message ID:
00394831
Views:
9
>I need to join 2 tables to link the key and reference to the
>other fields.
>
>Eg: Table : Customer (customer table with detial particular)
> Table : DayTrans (keeps daily transactions)
>
>The DayTrans table has a CustCode and I need to link it to
>Customer table by "CustCode" and retrieve the Customer.Address
>field. How could I do it by the SELECT statment?
>Is it using the JOIN INNER or OUTER? Pls advise, thanks.

What is your database engine? Access? Use the Access Query designer.

If it is another engine, you could create a dataenvironment, add a command and the you have the Query Builder button that will help you build query like the one you want.

Your query will look like this:
SELECT *
FROM Customer INNER JOIN DayTrans
ON Customer.CustCode = DayTrans.CustCode
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform