Have you tried using the IN operator which is a standard method for SQL. If 
non numeric you need to enclose values with single quotes. 
HTH

SELECT *column_name(s)*
FROM *table_name*
WHERE *column_name* IN (*value1*,* value2*, ...);

On Tuesday, July 4, 2023 at 1:41:57 AM UTC+1 Glenn Barker wrote:

> Hi, I'm totally new to this and need some advice.
>
> I'm currently using the QUERY function with the WHERE clause to filter an 
> IMPORTRANGE.  The WHERE clause has multiple conditions separated by OR 
> operators. Example of a working query that has 4 conditions using OR 
> operators:
>
> QUERY(IMPORTRANGE("[URL]","equipment!A2:T"),"SELECT Col1, Col3, Col9, 
> Col10 WHERE (Col10 = '"&Filters!F3&"' or Col10 = '"&Filters!F4&"' or 
> Col10 = '"&Filters!F5&"' or Col10 = '"&Filters!F6&"')")  
>
> The OR operators work fine for me in the circumstance that my list of 
> conditions to filter against is short.  However, I want to be able to 
> filter the IMPORTRANGE against a column of values that changes and could be 
> dozens or hundreds of values long... far too big for using a hardcoded 
> string of OR statements.
>
> How can I QUERY the IMPORTRANGE against all the values listed in a column 
> as the conditions? If I use an array as the condition for the query... for 
> example...
>
>  QUERY(IMPORTRANGE("[URL]","equipment!A2:T"),"SELECT Col1, Col3, Col9, 
> Col10 WHERE Col10 = '"&Filters!*F3:F100*&"' ")    
>
> ... it only returns the first condition in the column.  
>
> Greatly appreciate any response on how to solve this problem.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/cfd4c497-39ab-4153-9ac4-4296d3c0a951n%40googlegroups.com.

Reply via email to