Have a great weekend and thanks so much
Maybe post the finished query so it could benefit someone else.
Select top 40 myCode, sum(myQTY) as Quantity, count(myCode) as Count
from testmytable
where (t_stamp > DATEADD(minute, -50, GETDATE())))
Group by myCode
order by sum(myQTY) DESC;
It was like this at the finish
which was really confusing because I thought this had thrown an error on me before
It worked though