I have a Query JSON with SQL query and would like to filter out dates that are not within the current quarter. The source data ({{dailySubmissions.data}} has 4 keys of data: Name, Date, Region, Site, and I am only interested in the Name and Date.
I currently have:
SELECT Name, Date FROM {{dailySubmissions.data}}
WHERE DATE BETWEEN ???
I have tried setting the dates like so:
SET todaysDate = GETDATE();
SET startDate = DATEADD(q,DATEDIFF(Q,0,todaysDate),0)
SET endDate = DATEADD(d,-1,DATEADD(q,DATEDIFF(q,0,todaysDate) +1, 0))
and trying to put DATE BETWEEN startDate AND endDate but I don't think that is right.
And here is a JSON(import it as an app) that someone built and posted in the forum a while back - can't take credit for it...but I found it useful Timeframe.json (8.7 KB)