Search code examples
google-sheetsescapinggoogle-sheets-query

Escape column name in query (to avoid conflict with reserved words)


I have a Google Sheets and want to query in a column called BY. This is failing:

=query(Data!A:GC, "select BY where BG = 'completed'")

How can I escape that BY column name?


Solution

  • Please try backquotes - eg:

    =query(Data!A:GC, "select `BY` where BG = 'completed'")