SimonPGreen
IS-IT--Management
Hi,
Is it possible to reference a calculated field in a query?
I am self joining a table with the following:
The problem I have is that the in order to deduct the previous cumulative value (above in bold) which is calculated I have to reference it somehow.
Regards,
Simon
Is it possible to reference a calculated field in a query?
I am self joining a table with the following:
Code:
SELECT Applications.intValuationNumber, IIf(IsNull([Applications.dtePaymentExpected]),[Applications.
dtePaymentDueDate],[Applications.dtePaymentExpected]) AS [Due Date], IIf(IsNull([Applications.curCertificationValueReceived]),IIf(IsNull(
[Applications.curValuationExpected]),IIf(IsNull([Applications.
curValuationValueSubmitted]),[Applications.curForeCastValue],
[Applications.curValuationValueSubmitted]),[Applications.
curValuationExpected]),[Applications.curCertificationValueReceived]) AS [Gross Cumulative Value],[i] [Gross Cumulative Value]-iif(isnull([Gross Cumulative Value]),0,[b]Applications1.[Gross Cumulative Value][/b]) AS Movement[/i]
FROM Applications LEFT JOIN Applications AS Applications1 ON (Applications.intValuationNumber-1)=Applications1.intValuationNumber And Applications.fkPackageRef=Applications1.fkPackageRef;
The problem I have is that the in order to deduct the previous cumulative value (above in bold) which is calculated I have to reference it somehow.
Regards,
Simon