---
title: "SqlExpression Field in Crystal Report"  
description: "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 sp"  
author: "Chris Anderson"  
published: 2011-08-25  
updated: 2020-07-10  
canonical: https://www.mindstick.com/articles/616/sqlexpression-field-in-crystal-report  
category: "crystal report"  
tags: ["crystal report"]  
reading_time: 1 minute  

---

# SqlExpression Field in Crystal Report

SQL expressions are like formulas, but they are written in [Structured Query Language](https://www.mindstick.com/blog/11168/introduction-to-sql) (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](https://www.mindstick.com/articles/930/crystal-report-in-visual-studio-2010) with some product details (in [visual studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) 2010).

![SqlExpression Field in Crystal Report](https://www.mindstick.com/mindstickarticle/eb554c35-0236-49ca-a7ce-c2eb573e27e8/images/dd0ed62a-aec9-4846-b638-bddcae672abc.png)

![SqlExpression Field in Crystal Report](https://www.mindstick.com/mindstickarticle/eb554c35-0236-49ca-a7ce-c2eb573e27e8/images/eb5d5782-af81-4b9a-8f14-8ce27a94b5e6.png)

**To create an SQL [Expression field](https://www.mindstick.com/forum/310/sql-expression-field-in-crystal-report):**

In the Field [Explorer](https://yourviews.mindstick.com/view/81617/now-it-is-time-to-say-goodbye-to-internet-explorer), right-click on SQL Expression Fields and click new.

Enter a name in the Name box, and then click OK.

![SqlExpression Field in Crystal Report](https://www.mindstick.com/mindstickarticle/eb554c35-0236-49ca-a7ce-c2eb573e27e8/images/80eadf7f-9b26-4b4c-83e5-3ea3b47802b4.png)

![SqlExpression Field in Crystal Report](https://www.mindstick.com/mindstickarticle/eb554c35-0236-49ca-a7ce-c2eb573e27e8/images/36e9eb18-e724-4a60-93b1-8697d30cb849.png)

The SQL Expression Editor appears. The SQL Expression Editor [functions](https://www.mindstick.com/forum/34086/jquery-callback-functions) in the

same way as the Formula Editor.

\

Type the expression in the SQL Expression Editor.

Click the Save and close button.

![SqlExpression Field in Crystal Report](https://www.mindstick.com/mindstickarticle/eb554c35-0236-49ca-a7ce-c2eb573e27e8/images/eb2c5cb2-82ea-4442-a442-5c2c469da02c.png)

After adding an expression drag the field from the SqlExpression field and drop it into the details section of the crystal report.

![SqlExpression Field in Crystal Report](https://www.mindstick.com/mindstickarticle/eb554c35-0236-49ca-a7ce-c2eb573e27e8/images/742afdd3-0ca3-4e66-bcb5-953bab5a1d93.png)

You can see the output or preview of report from **Main Report Preview** or run an application.

---

Original Source: https://www.mindstick.com/articles/616/sqlexpression-field-in-crystal-report

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
