L
L
Lukyan2020-01-14 16:20:45
Google Sheets
Lukyan, 2020-01-14 16:20:45

How to always use columns named "ColN" in QUERY?

This formula works
=QUERY(DB!A1:L1143;"SELECT A, B, G")
But it doesn't work anymore
=QUERY(DB!A1:L1143;"SELECT Col1, Col2, Col7")
The file with the question .
How to use columns by names like "ColN" in QUERY?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-01-15
@Tartararu

Use Notation{ }

=QUERY({DB!A13:L1155};"
SELECT Col1, Col2, Col3

WHERE
( Col1 >= date'2015-10-22'
AND Col1 <= date'2015-10-25')
AND ( Col2 = 'Campaign_1'
OR Col2 = 'Campaign_2')

ORDER BY Col7 DESC")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question