Example 1: Select all student applicants and show all status information

SELECT EA7RECORDS.USERDEFINEDID "Applicant ID",
EA7RECORDS.FIRSTNAME "First name",
EA7RECORDS.LASTNAME "Last name",
T1.DESCRIPTION "Current status"

FROM EA7APPLICANTS
LEFT OUTER JOIN EA7RECORDS ON EA7APPLICANTS.EA7RECORDSID = EA7RECORDS.EA7RECORDSID
LEFT OUTER JOIN EA7APPLICATIONSENROLLMENTS AS EAE ON EA7APPLICANTS.EA7RECORDSID = EAE.EA7RECORDSID
LEFT OUTER JOIN TABLEENTRIES AS T1 ON EAE.STATUS = T1.TABLEENTRIESID

Example 2: Select all student applicants with a specific status and exclude all graduated students

SELECT EA7RECORDS.FIRSTNAME, EA7RECORDS.LASTNAME, TABLEENTRIES.DESCRIPTION as 'STATUS', EA7RECORDSTATUSLOGS.STATUSDATE, EA7RECORDSTATUSLOGS.STATUSREASON, EA7RECORDSTATUSLOGS.ISCURRENT

FROM EA7RECORDS
INNER JOIN EA7RECORDSTATUSLOGS ON EA7RECORDS.EA7RECORDSID = EA7RECORDSTATUSLOGS.EA7RECORDSID
INNER JOIN TABLEENTRIES ON EA7RECORDSTATUSLOGS.STATUS = TABLEENTRIES.TABLEENTRIESID

WHERE EA7RECORDSTATUSLOGS.ISCURRENT=-1
and TABLEENTRIES.DESCRIPTION != 'Graduated' -- exclude students with graduated status
and TABLEENTRIES.DESCRIPTION in ('Current Student','New Student') -- include students with only this status
Disclaimer: Blackbaud provides 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. Blackbaud 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.