Note: This code is written and intended for use in Microsoft Access and will not work in the SQL Server Query Analyzer.


Calculate the Recurring gift amount based on Installment Frequency.

Notes:


    • Semi-Monthly Installments are not calculated as it involves more complex calculations based on a number of different fields.
    • Irregular installments are not calculated as there is not a way to determine how many installments are made in any given time.
    • Daily installments are calculated by 365 days in a year, you can change this as needed.


      SELECT dbo_RECORDS.ID, Choose(dbo_GIFT.INSTALLMENT_FREQUENCY,dbo_GIFT.Amount*1,dbo_GIFT.Amount*2,dbo_GIFT.Amount*4,dbo_GIFT.Amount*6,dbo_GIFT.Amount*12,"",dbo_GIFT.Amount*26,dbo_GIFT.Amount*52," ",dbo_GIFT.Amount*1,dbo_GIFT.Amount*365) AS TotalAmount

      FROM (dbo_RECORDS INNER JOIN dbo_CONSTIT_GIFTS ON dbo_RECORDS.ID = dbo_CONSTIT_GIFTS.CONSTIT_ID) INNER JOIN dbo_GIFT ON dbo_CONSTIT_GIFTS.GIFT_ID = dbo_GIFT.ID

      WHERE (((dbo_GIFT.TYPE)=30));

      Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Structured Query Language and the tools used to create and modify SQL statements and Crystal Reports. Our Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.