Results 1 to 5 of 5

Thread: help with SQL joins

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22

    Post

    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

  2. #2
    New Member
    Join Date
    Jan 2000
    Location
    canada
    Posts
    15

    Post

    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.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22

    Post

    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

  4. #4
    New Member
    Join Date
    Jan 2000
    Location
    canada
    Posts
    15

    Post

    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 !!!

  5. #5
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    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).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width