I have a Google Sheets and want to query in a column called BY. This is failing:
BY
=query(Data!A:GC, \"select BY where BG = \'completed\'\")
so to use the column BY as an identifier you must use backquotes around it...
`BY`
CREDIT: JAMES @ https://productforums.google.com/forum/#!msg/docs/tFB_02gNceQ/-2IUvmnQBgAJ
Please try backquotes - eg:
=query(Data!A:GC, "select `BY` where BG = 'completed'")