The DEFAULTDIST7 table doesn't have any obvious joins but the dbo.BBDISTRIBUTIONS table does have the PARENTOBJECTTYPE field that can be used to specify that we're concerned only with default distribution values.  dbo.BBDISTRIBUTIONS.PARENTOBJECTTYPE is a numeric field linked to an API enum called bbMetaObjects. The bbMetaObjects enum for bbmoDefaultDist is "301" and is used in the WHERE clause in the following SQL query sample:

SELECT
      dd7.NAME AS 'DistributionName',
      ga.ACCOUNTNUMBER,
      ga.DESCRIPTION AS 'AccountDescription',
      bbd.AMOUNT AS 'Percentage',
      gp.PROJECTID,
      gp.DESCRIPTION AS 'ProjectDescription',
      class.DESCRIPTION AS 'Class',
      grants.DESCRIPTION AS 'Grants',
      spendable.DESCRIPTION AS 'Spendable/Non-Spendable',
      perf.DESCRIPTION AS 'Performance',
      re.DESCRIPTION AS 'The Raiser''s Edge'
FROM dbo.BBDISTRIBUTIONS AS bbd
      INNER JOIN dbo.BBTRANSACTIONDISTRIBUTIONS AS bbtd
            ON bbtd.BBDISTRIBUTIONSID = bbd.BBDISTRIBUTIONSID
      INNER JOIN dbo.DEFAULTDIST7 AS dd7
            ON dd7.DEFAULTDIST7ID = bbd.PARENTID
      INNER JOIN dbo.GL7ACCOUNTS AS ga
            ON ga.GL7ACCOUNTSID = bbd.GL7ACCOUNTSID
      INNER JOIN dbo.GL7ACCOUNTCODES AS ac
            ON ac.GL7ACCOUNTCODESID = ga.GL7ACCOUNTCODESID
      LEFT JOIN dbo.GL7PROJECTS AS gp
            ON gp.GL7PROJECTSID = bbtd.GL7PROJECTSID
      LEFT JOIN dbo.TABLEENTRIES AS class
            ON class.TABLEENTRIESID = bbtd.CLASS
      LEFT JOIN dbo.TABLEENTRIES AS grants
            ON grants.TABLEENTRIESID = bbtd.TRANSACTIONCODE1
      LEFT JOIN dbo.TABLEENTRIES AS spendable
            ON spendable.TABLEENTRIESID = bbtd.TRANSACTIONCODE2
      LEFT JOIN dbo.TABLEENTRIES AS perf
            ON perf.TABLEENTRIESID = bbtd.TRANSACTIONCODE3
      LEFT JOIN dbo.TABLEENTRIES AS re
            ON re.TABLEENTRIESID = bbtd.TRANSACTIONCODE4
 
WHERE
      bbd.PARENTOBJECTTYPE = 301 --301 is a constant to the API meta object bbmoDefaultDist

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.