Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Expression

Status
Not open for further replies.

rjm13

Programmer
Feb 1, 2002
60
US
I work with hundreds of thousands of records and would like to use SQL Expression to speed up the report and do the record selection in the first pass. I'm using Crystal 9.0. Is it possible to cut and paste the "Show SQL Query" from the Database menu into a SQL Expression and run? When I attempt to add a Select statemnent to the SQL Expression editor, it always results in an error message. Am I doing something wrong? I know SQL syntax, but how do you write SQL expressions to work in Crystal?
Thanks.

 
Depending upon the version, SQL expressions are used more for special functions or for subselects, not for entire queries. The feature which would allow you to paste in an entire query is the "Add Command" feature. Go to database->database expert->your datasource->add command and paste the query there.

Note that what is appearing in "Show SQL Query" is already what is being passed to the database.

-LB
 
btw, you don't require SQL Expressions to pass SQL, and Crystal doesn't send SQL on the second pass unless you're using subreports.

I would also suggest that you use Views or Stored Procedures instead to accomplish this to promote reusability and ease maintenance.

WHat usually gets people when using the Crystal interface for generating the query is a malformed record selection formula.

Here's my FAQ on the topic (a bit out of date, but still worthwhile):

faq767-3825

-k

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top