Google-sheets – query all dates within the date range

google sheetsgoogle-sheets-query

I have a Google Spreadsheet that I'm querying and the date is set as dd/mm/yyyy.

How can I query between the start and finish (ref cells) of each month, so the query only returns dates between the ref cells.

This is what I was trying to re-code:

=QUERY('Calculated Pay [view]'!B1:B1000,”select * where B>=date”””&text(A2,”dd/mm/yyyy”)&””” and B<=date”””&text(B2,”dd/mm/yyyy”)&””””)

Best Answer

Might be easier to add a column C with a formula such as:

=if(and(B1>eomonth(Sheet2!$A$2,-1),B1<=eomonth(Sheet2!$A$2,0)),"s",) 

and apply a simplified query such as:

=query('Calculated Pay [view]'!B1:C1000,"Select B where C ='s' ")