My query is not pulling my data correctly. I have two queries, each with a month and number. Most of the months exist in both files, but there are two occurrences where there is data in one and not the other. I have used a union query and have gotten half of the problem fixed but cannot pull the month name for records that only exist in one file. Hopefully the data snapshot and code will be clearer than my description. The 8 shown is for the month of June, but the month is not showing, just the data. Any help would be much appreciated. Note: I am pretty much of a novice.
FM |
MonApp |
Approved |
Closed |
|
|
|
8 |
1 |
July |
6 |
4 |
2 |
August |
6 |
1 |
3 |
September |
4 |
5 |
4 |
October |
9 |
3 |
5 |
November |
8 |
13 |
6 |
December |
4 |
|
7 |
January |
4 |
2 |
8 |
February |
4 |
5 |
9 |
March |
4 |
11 |
10 |
April |
6 |
8 |
11 |
May |
3 |
6 |
Code:
SELECT [Approved Studies by month totals].MonApp, [Approved Studies by month totals].Approved, [Closed Studies by month totals].Closed, [Approved Studies by month totals].FM
FROM [Approved Studies by month totals] LEFT JOIN [Closed Studies by month totals] ON [Approved Studies by month totals].MonApp = [Closed Studies by month totals].MonClosed
UNION SELECT [Approved Studies by month totals].MonApp, [Approved Studies by month totals].Approved, [Closed Studies by month totals].Closed, [Approved Studies by month totals].FM
FROM [Approved Studies by month totals] RIGHT JOIN [Closed Studies by month totals] ON [Approved Studies by month totals].MonApp = [Closed Studies by month totals].MonClosed