Add the Sum fanction in query

  • hi

    I'm try to sum the following columns{see query below}( CGTResults.UsableCapitalGain and CGTResults.UsableCapitalLoss).

    I would like which column to GROUP BY or what aggregate function should a add.

    Thanks

    SELECT CGTResults.UsableCapitalGain, CGTResults.UsableCapitalLoss, CGTResults.BaseCost, CGTResults.Proceeds, CGTResults.ExtraordDividend, FUND.FundName,

    ClientID.ClientCode, CGTInstrumentIDs.SecurityCode, InstrumentHoldings.ActionType, InstrumentHoldings.EffectiveDate, InstrumentHoldings.CurrencyWAV,

    CGTResults.CGTTransID

    FROM CGTInstrumentIDs INNER JOIN

    CGTResults ON CGTInstrumentIDs.CurrencyCode = CGTResults.CurrencyCode INNER JOIN

    ClientID ON CGTResults.CGTClientID = ClientID.CGTClientID INNER JOIN

    TaxFundClients ON ClientID.CGTClientID = TaxFundClients.CGTClientID INNER JOIN

    FUND ON TaxFundClients.TaxFundID = FUND.TaxFundID INNER JOIN

    InstrumentHoldings ON CGTResults.CGTTransID = InstrumentHoldings.CGTTransID

    WHERE InstrumentHoldings.ActionType = '8'

  • Sorted Thanks

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply