Search code examples
google-sheetsgoogle-sheets-formulagoogle-sheets-querygoogle-query-languageimportrange

Importrange query: time duration condition under 10 seconds


I'm trying to make a query(importrange) of this google-sheet file

I want to filter my data based on 3 conditions:

  1. Col5='GC' OR
  2. Col5='CL' AND
  3. In Col4 the time must be under 10 seconds.

I've been able to make a query on those data with a 1 minute time condition:

=QUERY(IMPORTRANGE("18OOzibH9rmuzNxOPo_EbZ1rhF32qESuvPa4x4pB1BmA", "data!A1:Q"), 
 "where Col5 matches 'CL|GC' 
    and minute(Col4) < 1", 1)

but if I just change "minute(Col4) < 1" in "second(Col4) < 10" it does not work, as you can see here, where the first four rows are over the criteria.


Solution

  • =QUERY(IMPORTRANGE("18OOzibH9rmuzNxOPo_EbZ1rhF32qESuvPa4x4pB1BmA", "data!A1:Q"), 
     "where Col5 matches 'CL|GC' 
        and minute(Col4) < 1 
        and second(Col4) < 10", 1)
    

    0