Ah, that was the next step.... I've taken it out and the adjusted code (1st set) below works again.
However, the second set of code is what I'm trying to do; add another criteria but this returns ambiguos outer joins. Which is why I was reversing my steps to try and get it to work.
So, in addition to the 1st code below, which now works, I also have a field (cptycode) in the tblbrokeragefeedataall table. I then have the Broker group table which has the same field. I am trying to exclude records whereby another field in the Broker Group table (Group Broker field) equals a certain value but clearly joining on the cptycode fields, adding the 'Group Broker' field to the query and then filtering out <>"Value" clearly doesn't work?
Again, really appreciate your help with this.
SELECT tblBrokerageFeeDataAll.prodtype AS [Product Type], Mid(["Site],2,1) AS Site, tblBrokerageFeeDataAll.exch, [tblbrokeragefeedataall].[commission]*[fx].[gbp monthly average rate] AS [Commission GBP], [tblbrokeragefeedataall].[brokeragefee]*[fx].[gbp monthly average rate] AS [BrokerageFee GBP], [tblbrokeragefeedataall].[miscellaneous]*[fx].[gbp monthly average rate] AS [Misc GBP], Sum([commission gbp]+[misc gbp]+[brokeragefee gbp]) AS [Total Fee 2010]
FROM tblBrokerageFeeDataAll, FX
WHERE (((tblBrokerageFeeDataAll.[Commission Currency])=[fx].[ccy])) OR (((tblBrokerageFeeDataAll.[BrokerageFee Currency])=[fx].[ccy])) OR (((tblBrokerageFeeDataAll.[Miscellaneous Currency])=[fx].[ccy]))
GROUP BY tblBrokerageFeeDataAll.prodtype, Mid(["Site],2,1), tblBrokerageFeeDataAll.exch, [tblbrokeragefeedataall].[commission]*[fx].[gbp monthly average rate], [tblbrokeragefeedataall].[brokeragefee]*[fx].[gbp monthly average rate], [tblbrokeragefeedataall].[miscellaneous]*[fx].[gbp monthly average rate]
HAVING (((tblBrokerageFeeDataAll.prodtype)="Equity"))
ORDER BY Mid(["Site],2,1), tblBrokerageFeeDataAll.exch;
SELECT tblBrokerageFeeDataAll.prodtype AS [Product Type], Mid(["Site],2,1) AS Site, tblBrokerageFeeDataAll.exch, [tblbrokeragefeedataall].[commission]*[fx].[gbp monthly average rate] AS [Commission GBP], [tblbrokeragefeedataall].[brokeragefee]*[fx].[gbp monthly average rate] AS [BrokerageFee GBP], [tblbrokeragefeedataall].[miscellaneous]*[fx].[gbp monthly average rate] AS [Misc GBP], Sum([commission gbp]+[misc gbp]+[brokeragefee gbp]) AS [Total Fee 2010], [Broker Group].[Group Broker]
FROM FX, tblBrokerageFeeDataAll LEFT JOIN [Broker Group] ON tblBrokerageFeeDataAll.cptyname = [Broker Group].cptyname
WHERE (((tblBrokerageFeeDataAll.[Commission Currency])=[fx].[ccy])) OR (((tblBrokerageFeeDataAll.[BrokerageFee Currency])=[fx].[ccy])) OR (((tblBrokerageFeeDataAll.[Miscellaneous Currency])=[fx].[ccy]))
GROUP BY tblBrokerageFeeDataAll.prodtype, Mid(["Site],2,1), tblBrokerageFeeDataAll.exch, [tblbrokeragefeedataall].[commission]*[fx].[gbp monthly average rate], [tblbrokeragefeedataall].[brokeragefee]*[fx].[gbp monthly average rate], [tblbrokeragefeedataall].[miscellaneous]*[fx].[gbp monthly average rate], [Broker Group].[Group Broker]
HAVING (((tblBrokerageFeeDataAll.prodtype)="Equity") AND (([Broker Group].[Group Broker])<>"value"))
ORDER BY Mid(["Site],2,1), tblBrokerageFeeDataAll.exch;