Help combining Queries

G

Guest

I have two Queries that I am trying to combine:

SELECT Year([OrderDate]) AS [Year], Month([OrderDate]) AS [Month],
Count(File_Tracking.FileNumber) AS CountofFileNumber
FROM File_Tracking
GROUP BY Year([OrderDate]), Month([OrderDate]);

which gives me the number of files ordered for each month. But I also have
another query:

SELECT Year([ClosingDate]) AS [Year], Month([ClosingDate]) AS [Month],
Count(File_Tracking.FileNumber) AS Files, Sum([Gross]) AS SumofGross
FROM File_Tracking
WHERE ([ClosingDate]) Is Not Null
GROUP BY Year([ClosingDate]), Month([ClosingDate]);

which will give me how many files closed in each month, as well as the sum
of gross dollars for each file. I have been trying to combine these two
queries into one query so that I could come up with percentages for each
month automatically, but I keep stumbling, any help would be greatly
appreciated.
 
G

Guest

I ws trying to get a percentage between the numbers of files odered in a
month and the number of files actually closed in a month. I was more
concerned with combining the queries into a single query, so the results
could be in one place.



mscertified said:
Percentages of what? Without knowing I don't see how we can help

Gregw said:
I have two Queries that I am trying to combine:

SELECT Year([OrderDate]) AS [Year], Month([OrderDate]) AS [Month],
Count(File_Tracking.FileNumber) AS CountofFileNumber
FROM File_Tracking
GROUP BY Year([OrderDate]), Month([OrderDate]);

which gives me the number of files ordered for each month. But I also have
another query:

SELECT Year([ClosingDate]) AS [Year], Month([ClosingDate]) AS [Month],
Count(File_Tracking.FileNumber) AS Files, Sum([Gross]) AS SumofGross
FROM File_Tracking
WHERE ([ClosingDate]) Is Not Null
GROUP BY Year([ClosingDate]), Month([ClosingDate]);

which will give me how many files closed in each month, as well as the sum
of gross dollars for each file. I have been trying to combine these two
queries into one query so that I could come up with percentages for each
month automatically, but I keep stumbling, any help would be greatly
appreciated.
 

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

Repost, Help with combining queries 2
Query Help 2
Help with a Query 2
Year to Date subquery 3
Joining multiple cross tab queries 1
Combining Date queries 1
Strange Behaviour in Crosstab 4
Monthly Totals 8

Top