I'm trying to create a query and have a problem.

I have a school number column, against which is cost column, against which is also a column with an option of "final" or "pending".

I need to create a query which gives the school number and the sum of all the costs which correspond to a given school number. However, I also need to have the sums that are "final" separate from the ones that are "pending." I don't know how to do the latter. Any ideas?