×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Join Query

Join Query

Join Query

(OP)
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?...


RE: Join Query

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
http://www.chase-international.com
Accredited Seagate Enterprise Partner

RE: Join Query

(OP)
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.

RE: Join Query

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
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)

RE: Join Query

(OP)
Well, I'm launching the report from Visual Interdev.  So how can I pass the recordset to Crystal Reports?

Thanks

RE: Join Query

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
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)

RE: Join Query

(OP)
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 = "http://AAA/BBB/ABC.rpt?user0=123&password0=456&sf="; & 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

RE: Join Query

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
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close