gannon24
asked on
Access Query in 2007
Access 2007 freaks out (“JOIN not supported”) when I put constant expressions in my left joins. I originally wrote this query in Access 2003, and it still works in Access 2007 as long as I don’t make any edits, but if I change anything (e.g., add a return to the end) , it won’t compile. If I take out the company part and latest cost, the query runs (but I get the wrong results, naturally).
Any idea how to include clauses like this in Access 2007?
-----
SELECT [AFAs].afa, sum( [quantity] * NZ( [Latest Cost].[Factory Cost] * NZ(1+[MRB/APB],1),List_Pri ce )) AS [Total Part Cost]
FROM ((AFAs LEFT JOIN Installed_Components ON [Installed_Components].AFA = [AFAs].afa) LEFT JOIN [Latest Cost] ON
([Latest Cost].[Part Number] = [Installed_Components].[pa rt_number] )
AND
([Latest Cost].[condition] = [Installed_Components].[pa rt_conditi on] )
AND
( [cpart]='Company Part')
AND
( [Latest Cost].[Factory Cost] > 0)
) LEFT JOIN [2011 Purchase complete parts] ON [2011 Purchase complete parts].[Material] = [Installed_Components].[pa rt_number] AND Installed_Components.part_ condition= 'new'
GROUP BY [AFAs].afa;
Any idea how to include clauses like this in Access 2007?
-----
SELECT [AFAs].afa, sum( [quantity] * NZ( [Latest Cost].[Factory Cost] * NZ(1+[MRB/APB],1),List_Pri
FROM ((AFAs LEFT JOIN Installed_Components ON [Installed_Components].AFA
([Latest Cost].[Part Number] = [Installed_Components].[pa
AND
([Latest Cost].[condition] = [Installed_Components].[pa
AND
( [cpart]='Company Part')
AND
( [Latest Cost].[Factory Cost] > 0)
) LEFT JOIN [2011 Purchase complete parts] ON [2011 Purchase complete parts].[Material] = [Installed_Components].[pa
GROUP BY [AFAs].afa;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mx it is in both views (query and design)
<but if I change anything (e.g., add a return to the end)>
...what does this mean exactly...?
...what does this mean exactly...?
You are going to need to remove the [cpart], [Factory Cost], and [part_condition] sections from the joins and place those either in a WHERE clause or a Having clause