View Full Version : subtotal in 1 column by criteria in another


PRR
12-12-2001, 10:46 AM
I have inherited a database that tracks accounting functions. In the underlying table, there is one column that contains the PO # and three more that divide the monies by encumberance, budget and suspense. How can I subtotal the monies by a criteria that is in the PO # column- i.e. all the PO's starting with 9's are for construction, so under the encumberance column, I want to subtotal all the po's for construction.

Jack Cowley
12-12-2001, 11:46 AM
A totals query should do the trick if I correctly understand what you want to do:

SELECT Sum(TableName.Encumberance) AS SumOfEncumberance
FROM TableName
WHERE ((Left([PO#],1)="9"));

The above assumes that the PO # is a Text field.