CA DACs: Historical Data

The CADailySummary data access class (DAC) keeps historical data about daily cash account balances. The CADailySummary records are updated on every CATran update that affects the date or status of a transaction.

The system uses CADailySummary to calculate the cash account balances on the Cash Flow Forecast (CA401000) and Cash Account Details (CA303000) forms.

The following SQL query counts credit and debit amounts for a cash account. (In this example, @CashAccountCD is the value that is passed as a parameter to the request.)

SELECT 
    SUM(CADailySummary.AmtReleasedClearedDr)
        + SUM(CADailySummary.AmtReleasedUnclearedDr) AS DrAmount, 
    SUM(CADailySummary.AmtReleasedClearedCr)
        + SUM(CADailySummary.AmtReleasedUnclearedCr) AS CrAmount 
FROM 
    CADailySummary 
    INNER JOIN CashAccount 
        ON CADailySummary.CompanyID=CashAccount.CompanyID 
        AND CADailySummary.CashAccountID=CashAccount.CashAccountID 
WHERE 
    CashAccount.CashAccountCD = @CashAccountCD 
GROUP BY 
    CADailySummary.CompanyID, 
    CADailySummary.CashAccountID