Help combining Queries

G

Gregw

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

Gregw

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.
 
Top