Using INNER JOIN and GROUP BY to help filter a Rest Get request

It’s a timestamp field according to the database. I’ve got that filter working. Stored procedures sounds interesting, but I would also be interested in how I could do it with the script.