March 7th, 2013, 05:11 AM
How to specify Natural Join in SQL/Access
Hi, I am trying to write the following SQL code but each time I try and execute it in MS Access I get the error 'Syntax error in FROM Clause'. Am I specifying the natural join incorrectly?
SELECT DISTINCT Customer.CustNo, CustBal
FROM OrderTbl Natural Join Customer
WHERE (OrdDate BETWEEN #02-01-07# AND #02-28-07#) AND CustState - 'WA';
March 7th, 2013, 06:01 AM
i don't think there is a natural join in msaccess
try using INNER JOIN with an appropriate ON clause
March 8th, 2013, 04:29 AM
Thanks for the suggestion. I have tried INNER JOIN in Access but I do not get the right output that I should. Maybe I will try exporting the table in SQL and use Natural Join.
March 8th, 2013, 05:13 AM
A natural join is an inner. It's just a short-hand notation for it (without the need to specify the join columns)
I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
Tips on how to ask better questions:
March 8th, 2013, 05:19 AM
could you please show what you tried