A
Andre Adams
I'm having a problem creating a query.
I have a Sales Query that I'm trying to run that is based off of the
following information.
1) Region (State in Which the Sales occured)
2) Banker (Person that Manages the money for the Client)
3) Master Client (Client that has an account through the firm with the Banker)
4) Budget (The annual amount of money we expect to recieve from the client)
The problem is, there is more than one Banker that manages money for the
same client. Now, what I did was, created a table just for Master Client.
Within that table I added a column that shows the budget for that client. So
within the query I connect that table to my main table and pull the budget
from it. Now, when I run the query it will show me all the information that
I asked for, but, if there is 2 different bankers with the same Master
Client, it shows me the Budget twice. How would I run the query to show the
overall Budget to be subtracted cumulatively no matter how many bankers are
assigned to the Master Client?
Below is the SQL to my current query. Thank you so much in advance, this is
a very rushed project so any help would be appreciated.
SELECT tblMasterClient.[Master Client], tblregion.Region,
Sum(tblAccounting.[Total Revenues]) AS [SumOfTotal Revenues],
tblBanker.Banker, tblMasterClient.[Year 2008 Budget]
FROM tblMasterClient RIGHT JOIN (tblBanker RIGHT JOIN (tblregion RIGHT JOIN
tblAccounting ON tblregion.ID = tblAccounting.Region) ON tblBanker.ID =
tblAccounting.Banker) ON tblMasterClient.ID = tblAccounting.[Master Client]
WHERE (((tblAccounting.[Sale Date]) Between [What Sale Date should I begin?]
And [What Sale Date should I end?]))
GROUP BY tblMasterClient.[Master Client], tblregion.Region,
tblBanker.Banker, tblMasterClient.[Year 2008 Budget];
I have a Sales Query that I'm trying to run that is based off of the
following information.
1) Region (State in Which the Sales occured)
2) Banker (Person that Manages the money for the Client)
3) Master Client (Client that has an account through the firm with the Banker)
4) Budget (The annual amount of money we expect to recieve from the client)
The problem is, there is more than one Banker that manages money for the
same client. Now, what I did was, created a table just for Master Client.
Within that table I added a column that shows the budget for that client. So
within the query I connect that table to my main table and pull the budget
from it. Now, when I run the query it will show me all the information that
I asked for, but, if there is 2 different bankers with the same Master
Client, it shows me the Budget twice. How would I run the query to show the
overall Budget to be subtracted cumulatively no matter how many bankers are
assigned to the Master Client?
Below is the SQL to my current query. Thank you so much in advance, this is
a very rushed project so any help would be appreciated.
SELECT tblMasterClient.[Master Client], tblregion.Region,
Sum(tblAccounting.[Total Revenues]) AS [SumOfTotal Revenues],
tblBanker.Banker, tblMasterClient.[Year 2008 Budget]
FROM tblMasterClient RIGHT JOIN (tblBanker RIGHT JOIN (tblregion RIGHT JOIN
tblAccounting ON tblregion.ID = tblAccounting.Region) ON tblBanker.ID =
tblAccounting.Banker) ON tblMasterClient.ID = tblAccounting.[Master Client]
WHERE (((tblAccounting.[Sale Date]) Between [What Sale Date should I begin?]
And [What Sale Date should I end?]))
GROUP BY tblMasterClient.[Master Client], tblregion.Region,
tblBanker.Banker, tblMasterClient.[Year 2008 Budget];