How to filter report data

When creating the report, you can set up a filtering condition. For this, click Hamburger menu Menu in the upper-left corner of Report Designer.

Open the filter editor

Then, click More Options menu More Options to open the Filter Editor.

In the Filter Editor dialog that opens, set up a new filtering condition.

To add a condition

1. Click the upper-level operator to select the operator based on which you want to add a condition:

  • AND displays the records when both conditions are TRUE.
  • OR displays the records when at least one of the conditions is TRUE.
  • NOT (AND/OR) meets the opposite condition set in the WHERE clause.

2. Click Add a condition icon Add a new condition to this group next to the upper-level operator and select Add Condition on the shortcut menu.

Add a new condition

3. By default, the first column from the table is displayed. If you want to change the column, click it and select another column from the dropdown list.

4. Click the operator to select the comparison or logical operator for the condition.

5. Click Enter a value to set the condition.

6. To save the changes, click OK.

Set a new condition

To remove the condition, click Remove the condition icon Delete next to the corresponding condition.

Add a new condition group

1. Click Add a condition icon Add a new condition to this group next to the upper-level operator and select Add Group on the shortcut menu.

2. Click the upper-level operator to select the operator based on which you want to add a condition.

3. By default, the first column from the table is displayed. If you want to change the column, click it and select another column from the dropdown list.

4. Click the operator to select the comparison or logical operator for the condition.

5. Click Enter a value to specify the condition.

6. To save the changes, click OK.

Set a new condition group

How to use filters

Let’s see how to filter data at a report level. For demo purposes, we are going to use the Product table from the AdventureWorks2019 database and filter data of the report by StandardCost that equals 486.7066.

First, create a report.

1. On the Database menu, click Report Designer.

2. In the Data Report Wizard that opens, select Standard Report and click Next.

Select a data report type

3. Select a connection, a Simple Table/View data type, and click Next.

Select a connection

4. On the Choose the table or view page, select the Product table and click Next.

Choose the Product table

5. On the Choose columns to display in your report page, select the columns to be added to the report and click Next.

Choose columns to display in your report

6. Click Finish to open a report template.

7. In the upper-left corner of Report Designer that opens, click Hamburger menu Menu and then click More Options menu More Options next to the Filter String field.

Open the Filter editor

8. In the FilterString Editor that opens, click Add a condition icon Add a new condition to this group next to the upper-level operator and select Add condition.

Add a condition

9. Specify the condition and then click OK:

  • Select the StandardCost column from the dropdown list as an operand
  • Set equals as a criteria operator
  • Enter 486.7066 as a value.

Specify the condition

10. Switch to the Preview view to see the result.

Preview the condition

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Query Builder for SQL Server.
Request a demo

Request a demo

If you consider employing the Query Builder for your business, request a demo to see it in action.
Ready to start using dbForge Query Builder for SQL Server?