PDA

Click to See Complete Forum and Search --> : help with SQL joins


Playmaker
Jan 25th, 2000, 05:11 AM
I'm trying to access data from two different tables and display them both in the details section of a data report. Can anybody help?

PS I'm using VB6 data report and SQL 7.

Thanks,
Eddie

VBfreak
Jan 26th, 2000, 01:21 AM
You need to use a join statement in SQL but this can get very complicated depending on the join you want to do. Give what you want to do and all.

Playmaker
Jan 26th, 2000, 02:04 AM
What I'm creating is a worker's comp program. And in this program, it prints checks to various claimants. I am using the VB Data Report designer to print my checks. I need to display, in the details section, data from two different tables. The two tables I am grabbing data from are 'CLAIMS' and 'PAYMENTS'. There's information from both that need to be displayed on the check. Does that give a better explanation of what I'm doing?

Eddie

VBfreak
Jan 26th, 2000, 08:44 PM
Well my friend! If you plan to use VB Data Report don't expect to be able to do much. I gather that you just want to do an inner join. I suggest that you use a query to produce your joint recordset and then all you have to do is place the data on the Report... much less head ache...

I wish you all the best !!!

JHausmann
Jan 27th, 2000, 09:09 AM
Create a view (you can do it in SQL Server, which you've indicated you're using). You access views in the same fashion that you do tables. For example

Create View v_Claim_pay
as
Select claims.reference, payment.invoice
from claims, payment
where condition

You then access v_Claim_Pay as though
it were a table:

select * from v_Claim_Pay



[This message has been edited by JHausmann (edited 01-28-2000).]