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!

Join Query

Status
Not open for further replies.

wf

Programmer
Feb 1, 2001
32
US
I want to do a union query like this one in crytal reports 8.0.


SELECT Pol, ENT_1ER, LN_1ER FROM tabla610 WHERE ENT_1ER ='27'
UNION
SELECT Pol, ENT_2DO, Ln_2do FROM tabla610
where ent_2do ='27'
UNION
SELECT Pol, Ent_3er, ln_3er from tabla610
where ent_3er ='27'

This query runs fine on Crystal SQL Designer but when I write in on Crytal Reports (Show SQL Query...) it gave me an error like 'query block has incorrect number of result columns'.

Any help?...


 
wf: Why not just design your report against the output of the SQL Designer? You won't be able to achieve what you're trying to do by only using the Report Designer (i.e. it doesn't recognise Union joins!) David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Well the problem is that this query is generated dynamically from Visual Interdev. Then I passed a selection formula to crystal and the report was generated. But with this fields began the problems because I don't know if crytal recognize joins and also I don't know how to pass a complete SQL (not a selection formula) to crystal.

To design my report looking at a query is a good idea but
I don't know if there is a way to save my query from Visual Interdev.
 
wf: Have a look at the PESetSQLQuery() which can be used to pass an entire SQL Select statement David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
If you are launching the report from an application (like VB) you may be able to generate the results as a recordset in the application, and pass the recordset to CR. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Well, I'm launching the report from Visual Interdev. So how can I pass the recordset to Crystal Reports?

Thanks
 
I am not familiar with how Visual Interdev integrates with CR. In VB you would use something like a "SetPrivateData" command, but there are different flavors of the syntax for different integration methods in VB.

What command do you use to launch the report? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I use the window.open command wich launch the report ABC.rpt

sf=Selection Formula.Here I send my selection formula.

strUrl and strOption are variables.


strUrl = " & SelFor & ""

strOption = "width=800,height=600,top=0,left=0,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes"

window.open strUrl,"PraicoBank",strOption
 
Sorry,

I don't know how (or if) you can pass a recordset in a web environment. You might ask this question in the CR-Integration forum. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top