title: select first day of month in google sheets query
body: <p>I am trying to construct a query that would among other columns return a date, which is in column J of an "rawData" table and change this date to the first day of month.</p>
  
  <p>In my query all date statements but the last one are for testing purposes. The last one causes an error (Unknown range name: 'J'.). Anybody knows where is the mistake? This is my query:</p>
  
  <p>=query(rawData;"select C, YEAR(J), MONTH(J)+1,
                           date'2010-08-31',
                           date '"&amp;TEXT(2010-10-1;"yyyy-mm-dd")&amp;"',
                           date '"&amp;TEXT(CONCATENATE("2020-12";"-01");"yyyy-mm-dd")&amp;"',
                           date '"&amp;TEXT(CONCATENATE(YEAR(J);"-";MONTH(J);"-01");"yyyy-mm-dd")&amp;"', 
                           SUM(L)
                        WHERE (C&lt;>'')
                          AND (F=18 OR F=20 OR F=62)
                        group by C, YEAR(J), MONTH(J)+1";1
        )</p>
  
  <p>Thanks,
  Andrej</p>