Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008

    Unanswered: Inserting SQL query in reports??


    Could anyone guide me as to how to insert SQL queries into CR11.
    I am a novice with SQL.

    I went to database -> Show SQL query and got this query...

    SELECT `Qy_MasterQuery`.`Name`, `Qy_MasterQuery`.`PeriodID`, `Qy_MasterQuery`.`Group`
    FROM `Qy_MasterQuery` `Qy_MasterQuery`

    When itry to insert this into ...

    Report -> Selection formulae -> Record -> SQL expression field ... i get an error - Sntax error. in query expression.

    Am i right in putting the expression? Please help

  2. #2
    Join Date
    Jun 2008
    Leyland in NW England, UK

    Thumbs up

    Hi Puskardas,
    You cannot use the SELECT statement in the SQL Expression field. The SQL Expression field is mainly for the use of SQL functions which can be used to query the database for specific sets of data. You can sort, group, and select data based on SQL expression fields e.g. CASE, LTRIM etc.

    If you wish to use the SELECT statement you need to use the Add Command facility. This is found in the Report Creation Wizard. When you are first trying to create a report you click on the Create New Connection option & select the sources where the data you wish to query is stored. Once you have done this then in the left hand box underneath the name or file path of the data source and above the folder holding the tables is a wizard button with Add Command written next to it. If you click on this then a screen opens into which you can enter your SQL SELECT query.


  3. #3
    Join Date
    Nov 2008

    crystal reports from sql

    the following link will help you.

    Dynamic Crystal Reports from SQL Query String


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts