So I have the SQL code below which helps me determine the change in DACE....now I want to incorporate another table "Loans"....where I want to figure out how to sum all loans that have a "C" or a "3" in the field "Status History" for a given month
I have a query that does what I want, but I am having a hard time incorporating that query into the SQL code below...
Here is the original SQL code I want to add to:
Here is the SQL query I want to incorporate somehow in the above SQL code:
Any help would be greatly appreciated as I'm not very good at Access.
I have a query that does what I want, but I am having a hard time incorporating that query into the SQL code below...
Here is the original SQL code I want to add to:
Code:
SELECT a.SECURITY_NAME, a.Mnth, (a.DACE-b.DACE) AS DACENetChange, a.DACE,
FROM Securities AS b, Securities AS a
WHERE (((a.SECURITY_NAME)=b.SECURITY_NAME) And ((a.Mnth)=#11/1/2011#) And ((DateSerial(Year(a.Mnth),Month(a.Mnth)-1,1))=b.Mnth));
Code:
SELECT Securities.SECURITY_NAME, Sum(Loans.[Curr Trust Bal(USD)]) AS [SumOfCurr Trust Bal(USD)]
FROM Securities INNER JOIN Loans ON Securities.Master=Loans.Master
WHERE ((Left(Loans![Status History],1)="C" Or Left(Loans![Status History],1)="3") And ((Securities.Mnth)=#11/1/2011#))
GROUP BY Securities.SECURITY_NAME;
Any help would be greatly appreciated as I'm not very good at Access.