Combining Results

G

Guest

I have three queries. One for Credit Card Sales, One for House Charge Sales, and one for Cash Sales. It displays every invoice and the quantity and price as well as extension. I want to be able to put into the report the sum of the extension field for each query giving me total sales for credit card, cash, and house charge. How can I accomplish this.
 
A

Allen Browne

The answer will depend on your table structure.

Ideally, all your sales will be in the one table, with a field that
indicates what type of sale it is (retail, or card, or house). With this
structure, the report you ask for is very simple. Just create a report, and
in the report's Sorting And Grouping dialog, group by Sale Type. With a
Group Footer for each one, you get your subtotals, along with the grand
total in the Report Footer.

If you have your amounts in different tables and this can't be changed, you
may be able to create a UNION query to combine them all into one, and then
base the report on that as discussed above.

If that's not possible, the other alternative is to create 3 reports (one
for each). Then create another report that contains these as subreports. You
can bring back the total from the Report Footer section in the subreport
back onto the main report with a text box that has a Control Source of
something like this:
=IIf([MySub].[Report].[HasData], Nz([MySub].[Report]![MyTotal], 0), 0)
where "MySub" is the name of your subreport control, and "MyTotal" is the
name of the text box in the subreport's Report Footer section.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

George Schneider said:
I have three queries. One for Credit Card Sales, One for House Charge
Sales, and one for Cash Sales. It displays every invoice and the quantity
and price as well as extension. I want to be able to put into the report
the sum of the extension field for each query giving me total sales for
credit card, cash, and house charge. How can I accomplish this.
 
G

Guest

Imy main tables are linked from SQL server. The querry is based on a pay type of $ or K for Cash, A, D,V,M for Credit Card, or C for house charge.
 

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

Top