0

I wrote the following query in a Google Sheet:

=QUERY(Prospects!$B$2:$DV; select D, L, B, AC, AH where Y = 'Aceptado' AND B > 42781 AND D IS NOT NULL order by B Asc label D 'Cliente'; 1)

42781 refers to a date (15/02/2017)

The query is well constructed but it doesn't return any values (no results).

If the date filter is removed the query returns lots of results so the issue is related to the date format.

=QUERY(Prospects!$B$2:$DV; select D, L, B, AC, AH where Y = 'Aceptado' AND D IS NOT NULL order by B Asc label D 'Cliente'; 1)

There are lots of results with B > 42781 (or B > "15/02/2017"). How should I enter the date value?

Thanks

TheMaster
  • 45,448
  • 6
  • 62
  • 85
Gonzalo
  • 39
  • 1
  • 11
  • Your link helped me a lot. thnx! On the other hand I couldn't fix it completely due to the following issue: I'm adding 2 date filters and the second date filter is based on the first ($F$5 + 30). This 'date YYYY-MM-DD' format doesn't work on the second and I don't know why /// `where B >= date '"&$F$5&"' AND "& B <= date ' "&$F$5 + 30&" ' "` – Gonzalo Jun 21 '18 at 12:07
  • You should use TEXT() https://stackoverflow.com/search?q=%5Bgoogle-spreadsheet%5D+query+date – TheMaster Jun 21 '18 at 12:21

1 Answers1

0

Try using AND B > date '2017-02-15'
It was the first link I got searching on Google...

iDevlop
  • 24,841
  • 11
  • 90
  • 149