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

Strange Crystal Reports 8 Problem 2

Status
Not open for further replies.

zivrap

Technical User
Aug 10, 2004
31
CA

Hi All,

I am creating a report using cr 8. It connects to an access 2002 database using an OLE DB connection. I need two tables on he report; lets say t1 and t2. However, I do not want to link the tables together. If I dont link them together the report will not show any data from the second table. If I do link them together the report shows data incorrectly. My question is can I use multiple tables on a report without linking them? If so, why can I not access any data from the second table I added(t2) ? Thank you all very much for your help.
 
You have to link them or else use one of them in the main report and the other in a subreport. If you explain what you are trying to do, maybe there is a way of linking the tables so that you don't need to use a subreport.

-LB
 
Hi lbass,

thanks for the reply. Here is what I am trying to do(simplified example).


Table 1

Custmer Name (PK) Month Sales
------------ ------- -------
John Jan 1000
John Feb 2000

Table 2

Customer Name (Pk) Month Budget Sales
------ ------- -------------
John Jan 1500
John Feb 2500
John Mar 3000
.... ... ....
John Dec 4000

Table 1 contains Year to date information, whereas table 2 contains yearly budget information. Joining the two tables doesnt really make sense. I need the Sales field from table 1 and budget sales field from table 2. Thanks for the help.
 
Why don't you want to link the tables together ? linking Table 1 to table 2 on Customer Name and month would result in 1 line per customer and month i.e.

Code:
Table 1              Table 2
Customer Name ------>Customer Name
Month         ------>Month
Sales                Budget Sales
would allow you to report

Code:
Customer Name    Month    Sales    Budget Sales
John             Jan      1000     1500
John             Feb      2000     2500
...
...


Gary Parker
MIS Data Analyst
Manchester, England
 
I would link them on {table.customerID} and probably do a left join FROM table 2 to table 1, since it looks like you want to show all the budget months, and only the sales year to date. You need that link so that the results from each table are matched by customer.

If this still doesn't work for you, you should your joins, explain what you mean by returning incorrect data, show a sample of the results you are getting, and a sample of how you would like them to be.

-LB
 

Thank you both very much for your help! Turns out I was using the wrong join type; guess thats what happens after a 9 hr day. Maybe there is something else you guys know of. In crystal chart are null values always converted to 0? When I plot the values, it shows 0 for all months after the Year to date instead of nothing. Thank you again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top