Wednesday, December 12, 2012 4:44 PM
I have 3 sales tables, we'll call them SalesA, SalesB and SalesC. In each of those tables, there is a field labeled [Sales Rep ID] that then has a relationship with a SalesRep table.
I want to sum all of the sales data in those 3 tables but I do not want to return a Sales Rep if they have no sales data. How would I write such a query?
Wednesday, December 12, 2012 5:34 PMModeratorI think you need to create a UNION ALL query between these tables and then SUM the Sales based on the [Sales Rep ID] column.
For every expert, there is an equal and opposite expert. - Becker's Law
Wednesday, December 12, 2012 6:12 PMThat did the trick. Thanks much.