Grouping data/Aggregate functions

  • Thread starter Thread starter MsDYJ
  • Start date Start date
M

MsDYJ

I'm working with data that deals with deliveries. Items are shipped by
different carriers each week. The carriers always remain the same but the
data does not..so 1 carrier can have lots of data. I'm wanting to get an
average of the amount of days it takes to them to get something where it
needs to go. How in the query can I get each carrier grouped with an average
of the days. Right now all I am getting is this...
Carrier Days
A 5
B 10
C 15
A 10
B 15
C 20

What I want is this...
Carrier Days(Averaged)
A 7.5
B 12.5
C 17.5

Thanks,
Diana
 
MsDYJ said:
I'm working with data that deals with deliveries. Items are shipped by
different carriers each week. The carriers always remain the same but the
data does not..so 1 carrier can have lots of data. I'm wanting to get an
average of the amount of days it takes to them to get something where it
needs to go. How in the query can I get each carrier grouped with an average
of the days. Right now all I am getting is this...
Carrier Days
A 5
B 10
C 15
A 10
B 15
C 20

What I want is this...
Carrier Days(Averaged)
A 7.5
B 12.5
C 17.5

SELECT Carrier, Avg(Days)
FROM table
GROUP BY Carrier
 
Back
Top