Query - showing different costs

G

Guest

I have done a lot of searching before posting this question but didn't come
up with anything, so I hope you can help.

I am trying to set up a query from a table that gives me the follwoing
results:-

The main part of the query shows OFFICER NAME, TEL NO and COST with a Sum Of
Cost so that the query just gives me a total cost for all calls made by
officer.

In my query I also have a field called PRIVATE, the data held in the table
is either Yes or No. I can work out how to summarize the cost of the PRIVATE
field by including PRIVATE in the query as well and putting either "Yes" and
"No" in the criteria.

What I would like to do, is show them both, the total cost of YES and NO.

What it looks like at present is:
OFFICER NAME TEL NO COST PRIVATE
John Doe 01634856412 £1.07 Yes

What I need is something like:-
OFFICER NAME TEL NO COST PRIVATE COST PRIVATE
John Doe 01634856412 £1.07 Yes £8.56 No

I hope I have explained this ok :)
 
A

Allen Browne

In query design view, depress the Total icon on the toolbar (upper sigma
icon) so you now have a Total row in the query grid.

In the Total row under the Officer and Private fields, accept Group By.
Under the Cost field, choose Sum in the Total row.

This will give you the total cost for each combination of Officer + Private.

(You will need to remove the Tel No field from the query grid unless you
want to group by Officer + TelNo + Private.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top