SqlExpression Field in Crystal Report
SQL expressions are like formulas, but they are written in Structured Query Language (SQL). An SQL expression can be used to query the database for specific sets of data. You can sort, group, and select based on SQL expression fields.
Here we have crystal report with some product details (in visual studio 2010).
To create an SQL Expression field:
In the Field Explorer, right-click on SQL Expression Fields and click new.
Enter a name in the Name box, and then click OK.
The SQL Expression Editor appears. The SQL Expression Editor functions in the same way as the Formula Editor.
Type the expression in the SQL Expression Editor.
Click the Save and close button.
After adding an expression drag the field from the SqlExpression field and drop it into the details section of the crystal report.
You can see the output or preview of report from Main Report Preview or run an application.