Reputation: 267
Quite simple question: I want a query that filters the current month, I got this one working:
=query(Sheet1!A9:F; "select sum(D) where A >= date '2016-10-01' and A < date '2016-11-01'"; 0)
I need to get sth like
(...) where A >= "'Year(Today())'-'Month(Today())'-01" (...)
but that doesn't work. :/
Upvotes: 2
Views: 9526
Reputation: 1
Assuming as an example...
A B
10/2/23 data
10/3/23 moredata
11/6/23 evenmoredata
I use:
=query(A2:B4,"SELECT A, B WHERE MONTH(A) = '"&month(today())-1&"'")
Upvotes: 0
Reputation: 1
This will query all the data from the 1st of the current month, to the last day of that same month.
A >= date '"&text(EOMONTH(TODAY(),-1)+1,"yyyy-mm-dd")&"' and A <= date '"&text(EOMONTH(TODAY(),),"yyyy-mm-dd")&"'
Upvotes: 0
Reputation: 17613
Try using "TODAY()" in upper case instead of "Today()". I read in this google forum that this query statements are case sensitive.
Upvotes: 1