I have a table containing trades from various endpoints. How do I get the average daily volume for a given endpoint?
I'm doing this, but I'm pretty sure this is not an avg daily volume.
select destination as EndPoint, DATEPART(dd, timeofexecution) as Daily, AVG(lastfillquantity)
WHERE destination IN ('BBBB','III')
GROUP BY destination, datepart(dd,timeofexecution)
order by datepart(dd,timeofexecution) desc