Combining queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two queries. One for MTD values and one for year to date values. How can I combine this report so I can show the results in one report.
 
Dear George:

You don't give a lot to go on, but I think I may know what you want to
accomplish.

The only query you would need is the one for MTD values. Inside the
report you can create annual group subtotals.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
I have two queries. One that shows the customwer, salesman,gallons sold, dollars sold, cost for the current month. I have another query displaying the same info for YTD which is up to the end of the previous month. I have a report that is grouped by salesman then my customer all this info. I tried linking the two queries into by using the customer number field but the totals come out all wrong. Each one of the queries is a totals query.
 
Dear George:

That's the kind of thing I expected. However, isn't it true that the
month queries add up to the annual query? Your report can add this up
for you using the "more detailed" month-by-month information, and give
you a subtotal at each year. I assume you are wanting this within
each salesman/customer set.

I strongly recommend you use the facilities profided with reports to
accomplish what you want.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
This would be true if I had a query for each month. Let me explain the layout and the theory behind this report. I'm linking up with our SQL Server database. I have the following tables one for Customer info, One for salesman info, one for order details, and one for order herader info. The first query I have is one that pulls off all the info I need regarding customer info by linking all these tables. The resulting query contains all ordernumbers,order quantity, order price, order extension, salesman,customer. I also calculating cost of an order by multiplying order quantity by our cost field. This is a totals query. The next query I have written is one to get the orders based on the first query. It specifies the beging and end of month so it can be run at any given time. I have a similar query which does the same for YTD where YTD is defined as the point up yp the end of the month. Lets say the report was run on december 12th the YTD info would be as of 11/30/2003. I want to be able to combine the queries so the report can show both current month values as well as YTD. ANy help wpuld be most appreciated
 
Back
Top