Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing SQL for DB2 in MS Access 97

Status
Not open for further replies.

grunasal

Programmer
Aug 28, 2000
3
US
I need some help on how to write an inner join SQL query between two tables in Access 97. Not sure where to go from here.
 
What type of query: select, make table...with an inner join? What are the table names and the fields you would like?
 
Here's a Select example:


SELECT [Sales Order].[Sales Order Number], [Sales Order].[Sales Date], IIf(Not IsNull([Company]),[Company],[Last name] & ", " & [First Name]) AS [Company Display], [Sales Order].Tax, [Sales Order].[Tax 2], [Sales Order].Freight, [Sales Order].Other, [Sales Order].[Create Invoice], [Sales Order].[Invoice Number]
FROM [Sales Order] INNER JOIN Customers ON [Sales Order].[Sold to Customer] = Customers.[Customer Number]
WHERE (([Sales Order].[Sales Date] Between [Forms]![Invoice Batch Create]![Start Date] And [Forms]![Invoice Batch Create]![End Date]) AND ((IsNull([Sales Order].[Invoice Number]))<>False))
ORDER BY [Sales Order].[Sales Order Number];
 
It's a select query with an inner join.

Below is the SQL, please tell me what I'm missing:

SELECT ARLIB.TWMCLAMP.MCCLM#, ARLIB.TWMCLAMP.MCINV, ARLIB.TWMCLAMP.MCVEND, ARLIB.TWMCLAMP.MCDTPO, ARLIB.TWMCLAMP.MCCCST, ARLIB.TWMCLAMP.MCWD, ARLIB.TWMCLAMP.MCIVDT, ARLIB.TWMCLAMP.MCIQTY, ARLIB.TWMCLAMP.MCICST, ARLIB.TWMCLAMP.MCIDIS, ARLIB.TWMCLAMP.MCMQTY, ARLIB.TWMCLAMP.MCMCST, ARLIB.TWMCLAMP.MCMDIS, ARLIB.TWMCLAMP.MCCHDT, ARLIB.TWMCLAMP.MCCPNY, ARLIB.TWMCLAMP.MCBINC, ARLIB.TWMATCDP.MDISBN, ARLIB.TWMATCDP.MDBINC

FROM ARLIB.TWMCLAMP INNER JOIN ARLIB.TWMATCDP
ON ARLIB.TWMCLAMP.MCVEND = ARLIB.TWMATCDP.MDVEND AND ARLIB.TWMCLAMP.MCINV = ARLIB.TWMATCDP.MDINV
AND ARLIB.TWMCLAMP.MCDTPO = ARLIB.TWMATCDP.MDDTPO AND ARLIB.TWMCLAMP.MCBINC = ARLIB.TWMATCDP.MDBINC

WHERE ARLIB.TWMCLAMP.MCVEND =
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top