Search code examples
sqldategoogle-sheetslabelgoogle-query-language

How to combine select, label, where and date functions in Google Sheets


I have most of this query working, where it's pulling in what I want by the correct date, but I just can't seem to work the Label function in correctly to rename the columns.

Here is the functioning query: =QUERY(Results!A1:I500,"SELECT B, A, F, G, H, I WHERE D = 'project' and B >= date '"&TEXT(TODAY(),"yyyy-mm-dd")&"'",1)

I've tried adding in Label B 'Date' in various places but it always breaks the query and since I have only been doing this for an afternoon largely with the help of google, I figured maybe someone else knows better.


Solution

  • use:

    =QUERY(Results!A1:I500,
     "select B,A,F,G,H,I 
      where D = 'project' 
        and B >= date '"&TEXT(TODAY(),"yyyy-mm-dd")&"'
      label B'date'", 1)