I'm trying to create an external data link using Microsoft Query. How
do I write SQL in Microsoft query that will return a max date and sum
an amount field for the max date only?
Current SQL is as follows:
SELECT DISTINCT CB_PORTFOLIO_DMN.PORTFOLIO_NAME,
Max(CB_POOL_PORTFOLIO.POST_DATE), Sum(CB_POOL_PORTFOLIO.EXPOSURE_AMT),
Count(CB_POOL_PORTFOLIO.NBR_AVG_MATY_YRS)
FROM CB06U.CB_POOL_PORTFOLIO CB_POOL_PORTFOLIO, CB06U.CB_PORTFOLIO_DMN
CB_PORTFOLIO_DMN
WHERE CB_PORTFOLIO_DMN.PORTFOLIO_ID = CB_POOL_PORTFOLIO.PORTFOLIO_ID
GROUP BY CB_PORTFOLIO_DMN.PORTFOLIO_NAME
This returns the sum of the exposure amount for all rows, not just the
max post date.
--
amarch00Posted from - http://www.officehelp.in
Bookmarks