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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Select Expert for SQL on Crystal 8.5

Status
Not open for further replies.

ChrisH2

Programmer
Apr 18, 2002
44
GB
Hello all,

I am a newbie to Crystal reporting so please bear with me. I want to incorporate the following SQL statement in my select expert so that the records are selected at the server.

SELECT CustCode, CustName, AccBal, CreditLimit FROM CUSTOMER Where AccBal > CreditLimit

The problem is that I can only know how to do this as a composite formula, which filters the record set locally and not down at the server.

Thanks in advance,

Chris
 
Just insert the fields CustCode, CustName, AccBal, CreditLimit into your report and create a record selection formula: {AccBal} > {CreditLimit). CR will generate the SQL statement you want - just look at the menu Database/View SQL Statement to verify. If your database system allows this SQL to be processed on the server, it will.
 
The expression:

AccBal > CreditLimit

May not make it to the SQL. You might try writing this expression in the CR SQL expression editor, and then using the expression field in the select expert. This might force it into the WHERE clause. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top