Multiple FROM Clauses in VBA code for a single block of code
Posted on 2014-02-01
Why are three FROM clauses needed below..I assume the second FROM clause is needed to build the first ? If that is the case does the order of the FROM clause matter ?
Note the below works..I am just trying to understand it....
Select G.Client, G.Date
FROM (Select LEFT([FullClientName,40) AS Client,Date
WHERE [Product] = 'Pizza') AS GROCERY
INNER JOIN (Select LEFT([FullClientName,40) AS Client,Date
WHERE [Product] = 'Soybeans' AS AG
ON GROCERY.CLIENT = AG.CLIENT
GROUP BY GROCERY.CLIENT,GROCERY.DATE AS