I'm trying to combine two different queries so I can run a report that shows all of the crops FarmerID is growing as well as the number of livestock . One query is labeled qryCrops and the other qryLivestock. Both queries have the same FarmerID. The problem is I have a variety of scenarios: some farmers have multiple crops and only one type of livestock, other farmers have one crop and multiple types of livestock, some have multiples of both, etc. Whenever I try connecting the data, Access automatically doubles the information.
I've tried joining data which hasn't worked. A query with a left join won't duplicate the crops, but will duplicate livestock. A query with a right join won't duplicate the livestock, but will duplicate the crops. I've tried running a left and right join query separately, and then combining both queries into a Union query, and my data still is getting doubled (I suspect that's not the right option as I'm not comparing apples to apples). Nothing seems to work! I've tried searching the internet and have been unsuccessful at finding a solution.
Here is an example of what I want:
| FarmerID |
Acres |
CropType |
LivestockNum |
LivestockType |
| Farmer A |
6 |
Pasture |
3 |
Cows |
| Farmer A |
10 |
Hay |
|
|
| Farmer B |
15 |
Pasture |
2 |
horses |
| Farmer B |
|
|
100 |
chickens |
This is what I get when I combine the data:
| FarmerID |
Acres |
CropType |
LivestockNum |
LivestockType |
| Farmer A |
6 |
Pasture |
3 |
Cows |
| Farmer A |
10 |
Hay |
3 |
Cows |
| Farmer B |
15 |
Pasture |
2 |
horses |
| Farmer B |
15 |
Pasture |
100 |
chickens |
If there is data missing, I want Access to leave it blank instead of filling in the blanks itself, if that makes sense.
What do I do? Any help or advise is greatly appreciated!