0
=query('Network Trade Data_2'!$AA$1:$CP,"Select AA, AC, BY where AC is not null",1)

I am just trying to pull in column BY but getting an error due to by also being a command. Any help would be greatly appreciated!

player0
  • 124,011
  • 12
  • 67
  • 124

2 Answers2

1

This is a known problem ."BY" is a reserved word in query strings since "by" is an actual syntax word you might use. The easiest fix is to change your range to an array and refer to things by their column numbers instead of range refs.

=query({'Network Trade Data_2'!$AA$1:$CP},"Select Col1, Col3, Col53 where Col3 is not null",1)
MattKing
  • 7,373
  • 8
  • 13
1

the other fix would be to use `:

=QUERY('Network Trade Data_2'!AA1:CP, "select AA,AC,`BY` where AC is not null", 1)
player0
  • 124,011
  • 12
  • 67
  • 124