Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step tutorials and online videos.

Click Here To Learn More »

13.08 SQL Statements

Working with SQL Statements

Reports connect to databases which in turn return a set of records. The portion of the report’s design that works with data is translated into a SQL statement that is syntactically valid for each specific data source.

Crystal Reports gives you many ways to customize the SQL statement that is passed to the database. This can be done while designing a report as well as during runtime. A few reasons for customizing the SQL is to create more sophisticated SQL queries, increase the database’s performance, or to perform runtime customization according to a user’s input.

Crystal Reports breaks a SQL statement into three distinct parts: table selection, filtering records, and sorting/grouping. Each of these parts is identified by a SQL keyword. The SELECT keyword specifies the tables and fields to use. The WHERE keyword specifies which records should be included and which should be filtered out. The SORT BY and GROUP ON keywords specify how to perform the sorting and grouping of the records. The following sections explain these three parts of the SQL statement and show the options for customizing them.

Selecting Tables and Fields

The Database Expert dialog box makes the selection of tables and fields a piece...

Get UNLIMITED Crystal Reports Online Training!

Click Here To Start Your Training!

1500+ Tutorial Pages

Complete Crystal Reports Online Training with over 1,500 pages of better than book quality Crystal Reports tutorials.

Step-by-step Online Videos

Learn at your own pace from the comfort of your home! Pause, rewind and watch online training videos anytime!

Online Community

Members-only community where you can post and answer questions. The community is checked on a regular basis by best selling Crystal Reports book author Brian Bischof to help answer your questions.

Cut & Paste Source Code

Save time with simple cut and paste source code you can use right now in your next report!

Click Here To Start Your Training!