/
How to get SQL Query from Crystal Report

How to get SQL Query from Crystal Report

Description of Issue

How to find the SQL query a Crystal Report is using in the background to use on the SQL Server.

Context
  • EERP(Munis)

  • Crystal Reports

  • SQL Server

  • SSRS Reports

  • Tyler Reporting Services

  • Crystal to SSRS

Cause

Client is looking to find the SQL query a Crystal Report is using to test the query on the SQL Server database, or possibly convert the Crystal Report to an SSRS report. 

Resolution

Once connected to an ODBC connection and datasource in Crystal Reports, you can find the SQL query a report is using in the background:

  1. Click Database in the top ribbon of the Crystal Report. 

  2. Click Show SQL Query...

This opens a window with a SQL query the report is using to generate the data. This can be copied from this window to use in other applications like SQL Server Management Studio and SSRS Report Builder.

Additional Information

The SQL query generated may not include all the filters in Crystal Reports.