If you don't mind not having the first field in full you could probably do:
select left([field 1],9) as smlfield1,[field 2],avg([field 3]) as AverageCost
From table
group by left([field 1],9),[field 2]
Check the avg function (average) or build in the query builder...
Vince