I am recreating some Access queries in SQL Server. Exporting the Access query is easy enough. And while there are plenty of syntax differences between Access and T-SQL, I understand those differences fairly well. Except one. I've seen this in a couple of different queries now. I understand that Access uses parentheses with joins, that is not my issue. However, this query seems to have a nested join and I have questions about it.
First question. You can clearly see the first table in my From Clause, but why doesn't an "ON clause" follow immediately after? Instead, the "On Clause" seems to be the very bottom row of code I posted below.
INNER JOIN ((((dbo.rpt_SalesHistory
INNER JOIN [CorrectionList] ON dbo.rpt_SalesHistory.ItemClass = [CorrectionList].ItemClass)
INNER JOIN [RegionalManagerCorrect] ON (dbo.rpt_SalesHistory.MGPSalesPerson = [RegionalManagerCorrect].MGPSalesPerson)
AND (dbo.rpt_SalesHistory.CustomerShortName = [RegionalManagerCorrect].[Business Unit Name])
AND (dbo.rpt_SalesHistory.business_unit = [RegionalManagerCorrect].[Business Unit]))
INNER JOIN [SalesGroupCorrection] ON dbo.rpt_SalesHistory.CustomerShortName = [SalesGroupCorrection].[Customer Short Name])
INNER JOIN [PrimaryVendor] ON dbo.rpt_SalesHistory.OrrPN = [PrimaryVendor].ITEMNMBR)
ON ([PrimaryVendor].PRIMVNDR = dbo.table1.VENDORID) AND (dbo.table1.ITEMNMBR = [PrimaryVendor].ITEMNMBR)
I've tried joining these tables in SQL a number of different ways, but I cannot get anywhere near the row count that I get in access, so my I haven't joined them correctly yet. Does anyone know how to interpret this as a SQL From Clause?