Hello!
First time posting, and the first thing I want to mention is I literally have almost zero knowledge in Access and SQL. I took an SQL class in college and It was relatively simple.
My Situation:
I work at a bank. There was a request to one of our employees for a report that listed accounts that were overdrawn from. The list would only include accounts that had overdrawn three or more months.
My issue:
With my very basic understanding of Access and using SQL, I have managed to come up some "code" to show accounts that appear in more than 1 month.
Code:
SELECT distinct January.Account, February.Account, March.account
FROM march
INNER
JOIN (february INNER JOIN January
ON february.account = January.Account)
ON march.account = January.Account;
I can not figure out how to do more than those three months.
This provides me with the accounts that appear in all of the listed months. If I do not use the distinct modifier, I run into an issue where , if an account number appears in January 7 times, that account number will carry over into April’s query for all 7 times, even though that account was only overdrawn 3 times in April.
The next issue I'm running into is, I know that once I start adding months April-December, it is only going to give me accounts that show up in every month, instead of 3 or more.
Any help on getting this to work right would be greatly appreciated. I will continue looking for resolutions myself.
Thank you!
-John
Edit:
Code:
SELECT DISTINCT January.Account, February.Account, March.Account, April.Account
FROM January, February, March, April
WHERE (((January.Account)=[February].[Account])
AND ((February.Account)=[March].[Account])
AND ((March.Account)=[April].[Account]));
Played around in design view, and that came up with this. Again, my issues falls into where, it's only showing accounts that are in every month, rather than 3 or more.