0
votes

I am using IMPORTRANGE to bring in outside data and then making a QUERYDATA sheet using the following:

The Select statement in cell A3 and the Query statement in cell A4 and this has been working great.

A3 is ="select D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA WHERE E >= Date '"&TEXT(B2,"yyyy-mm-dd") & "'and E <= Date '" & TEXT(C2,"yyyy-mm-dd") & "'"

A4 is =QUERY(Data!A1:AA,A3,1)

I now what to add and additional WHERE (Where D = 'NYC'), but keep getting an error when adding it in my select statement in A3. I have tried it just before the WHERE E date range and then again after.

1

1 Answers

0
votes

You don't say what kind of error you are getting. The following value in A3 does not result in an syntax error:

="select D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA 
  WHERE D = 'NYC' and 
        E >= Date '" & TEXT(B2,"yyyy-mm-dd") & "' and 
        E <= Date '" & TEXT(C2,"yyyy-mm-dd") & "'"

If it doesn't work for you, please share s copy of your sheet, with no sensitive data, so we can see the error you are getting.