Using UNION ALL with Aggregate Function in ExecuteSQL
I'm wondering why this ExecuteSQL statement is giving me a syntax error...
SELECT SUM(units_sold) AS SumOfUnits, SUM(total_earned) AS SumTotalEarned
SELECT units_sold, total_earned
SELECT quantity AS units_sold, subtotal AS total_earned
FROM table2 )
I'm following the example exactly from this article... http://www.upsizing.co.uk/Art17_UnionQuery.aspx
I've been able to use UNION ALL in other ExecuteSQL statements, but when I try to aggregate data across the UNION, filemaker is giving me a syntax error. This is correct SQL, is it not?