Getting Hourly Average
|Added at||2017-01-04 04:01|
I'm fairly new to coding and would appreciate all the help I can get. I am trying to get hourly amount values from my transaction table. It collects data at various times. I would like to get the hourly average per each cashier ID with the output showing the start of the hour. Additionally, my table is rather large so I am trying to only get the hourly averages between a particular date. Here is a snippet of my table:
This is what I am trying to achieve.
I figured out how to filter the trans_time by the hour but am having difficulties calculating the average. Currently I have
I looked at other questions similar to mine but they all only used the count function for hourly values. I tried AVG(Amount) in place of Amount in the select statement but got an "not a single-group group function" error. I was thinking maybe another inner select but couldn't figure out what the conditions would be. Please correct what I have so far if it's wrong as well. Thanks.