Search code examples
google-sheets

Understanding a Query function error message


I am trying to pull the data from 2 dates only but I am getting a error:

Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: A

Here is the query function that I used: QUERY(IMPORTRANGE(FORMULA!A2,"RawData6.4.23!A2:I500"), "SELECT A, B, C, D, E, F, G, H, I where I > '2023-04-05' and I < '2023-04-06'") How can I resolve this issue? Thx


Solution

  • You have to use the Col# notation and you also need the date keyword when working with dates. Try this out:

    =QUERY(IMPORTRANGE(FORMULA!A2,"RawData6.4.23!A2:I500"), 
       "select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9
        where Col9 > date '2023-04-05' and Col9 < date '2023-04-06'")