Join on 3 tables in bigquery
<p>I have the below query in my BQ. Basically i have 3 tables (Users, product and Visits), and i am trying to make a join on date.</p>

<pre><code>SELECT
  product.Date,
  SUM(product.quantity) AS quantity,
  SUM(users.Users) AS users,
  SUM(visitsdata.Visits) AS visits
FROM (
  SELECT
    product.Date,
    product.product,
    users.date,
    users.Users,
    visitsdata.Visits
  FROM
    [Testdata.productsold] AS product
  JOIN
   [Testdata.userswithpurchase] AS users
  ON
    product.Date=users.date) AS usersproduct
JOIN
  [Testdata.visits] visitsdata
ON
  usersproduct.Date= visitsdata.date
GROUP BY
  product.Date
</code></pre>

<p>I am not an expert in writing query, but can someone please tell me what is wrong with my query?</p>

<p>Thanks</p>