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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

something wrong with this join

Status
Not open for further replies.

qwertyjjj

Programmer
May 27, 2005
70
GB
Access doesn't like the inner join here. Any ideas why?

SELECT Structure.[Div Level Description],
((SUM([1To90]) + SUM([Not Due]) + SUM([91To120])) / 1000) AS [Months0To3],
((SUM([121To150]) + SUM([151To180])) / 1000) AS [Months4To5],
(SUM([181To365]) / 1000) AS [Months6To12],
(SUM([MoreThan366]) / 1000) AS [Months12+],
((SUM([1To90]) + SUM([Not Due]) + SUM([91To120])) + (SUM([121To150]) + SUM([151To180])) + SUM([181To365]) + SUM([MoreThan366])) / 1000 AS TotalDebt
FROM (zarageddebt_CURR
LEFT JOIN Structure ON Structure.[Cost Centre]=zarageddebt_CURR.[Profit ctr])
INNER JOIN baddebt_CURR ON Structure.[Cost Centre]=baddebt_CURR.[Profit ctr]
GROUP BY Structure.[Div Level Description];
 
I wonder why an outer join on Structure ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
There are some NULL fields in zarageddebt_CURR, so I want it to pick up those fields but get other information from Structure.

With SQL Server, you just put all the joins in without brackets, so this is confusing me somewhat as it changes the structure of the joins somehow ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top