sum query regardless of different transaction dates

G

George

Hi,
i have two related questions:
I have a union query that returns a whole heap of transactions over a date
period (the date period in the query is sourced from a form).I would like to
have a query that sums all the transactions in that query even though many of
the transactions appear on different dates.
Is this possible?
Thanks
George
 
J

John W. Vinson

Hi,
i have two related questions:
I have a union query that returns a whole heap of transactions over a date
period (the date period in the query is sourced from a form).I would like to
have a query that sums all the transactions in that query even though many of
the transactions appear on different dates.
Is this possible?
Thanks
George

Of course. Why not? Just don't include the date field in the totals query.

What specific problem are you having? Could you post the SQL?

And what's your second question?
 
G

George

My second question is that i want to list 10 of these different summed union
queries in the one report as they each represent a different category.
the dates are a must as i need the total transactions over a period.
is it better to build this firstly in a query or in a report?

here is my SQL thus far:

SELECT * FROM [Generic Local Transaction Query]
Where FUND = "All local beef sales"
UNION SELECT * FROM [Global Transactions Query]
WHERE Fund = "Global beef sales";


Thanks
George
 
J

John W. Vinson

My second question is that i want to list 10 of these different summed union
queries in the one report as they each represent a different category.
the dates are a must as i need the total transactions over a period.
is it better to build this firstly in a query or in a report?

here is my SQL thus far:

SELECT * FROM [Generic Local Transaction Query]
Where FUND = "All local beef sales"
UNION SELECT * FROM [Global Transactions Query]
WHERE Fund = "Global beef sales";

You don't give any indication here what you want summed or what the date field
might be. Nor have you given any indication of why you can't do the totals
query (even if the query includes a date field used as a criterion you don't
need to Group By that field!)

I appreciate your trust in our clairvoyance but it's impossible to give a
useful answer without more information - such as the SQL of [Global
Transactions Query] or at least an indication of the relevant fields in that
query.

You do know that you can base a selective Totals query on a UNION query,
right?
 

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