Hi Jarry,
I might not understand your question right - what are you trying to do exactly? With the SQL editor you are able to do flexible dates like
And str_to_date(concat(date_format(table
.created_At
, ‘%Y-%m’), ‘-01’), ‘%Y-%m-%d’) BETWEEN str_to_date(concat(date_format(date_add(now(), INTERVAL -12 month), ‘%Y-%m’), ‘-01’), ‘%Y-%m-%d’)
AND str_to_date(concat(date_format(date_add(now(), INTERVAL -1 month), ‘%Y-%m’), ‘-01’), ‘%Y-%m-%d’)
what gives you always (as an example) the last 12 months rolling.
So if you then group by it as well you get the data per month for the last 12 months.
Do you mean something different? I did quite some queries with rolling dates by now so hope I can help you!
Cheers, Eva