BAQ in v6.1 Blank Title 72206

In our organization, in order to quote a new job for a part we've run
before, we use an MSAccess database/report to view job-history for the
part in question, and look at the cumulative elapsed-times for
labor-details on the machining operations.

I was thinking of writing a BAQ to do the same thing. My question is:

Can I write a BAQ that instead of showing "EACH" labor-detail for a job,
it will show only the cumulative totals for the labor-detail of the job?
In other words, can I use do like "Group By" in a BAQ?

Also - is it possible to write a BAQ that will prompt the user for a
part-number, then run the query on that input, instead of hard-coding
the part-number into the BAQ itself?