Results 1 to 4 of 4

Thread: help with Views in VB6

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22

    Post

    Hi,
    I creating a program that will print checks using the VB6 Data Report. I
    want to be able to access data from two different tables in the details
    section of the data report. I'm creating a view in SQL 7, that includes the two
    tables that I need data from to be printed on the check. I want the view to
    act like an ordinary table with the desired data in it. But everytime I run
    a select on the data in Query Analyser it continues to run for about 20
    minutes with thousands of records when there should only be about 2 thousand
    records. Please help! I have a deadline on this project. Thanks.

    Eddie


  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163

    Post

    Your on the right track a view is what you need. Why don't you post the select statement from your view and some info on the underlying table and maybe someone can help you.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    22

    Post

    Here's the select statement I'm using:

    SELECT Claims.InjuryDate, Claims.ClaimantName, Claims.SS#,
    Claims.LocationCode, Claims.OccupationCode,
    Payments.TypeCode, Payments.Amount,
    Payments.PaymentDate, Payments.StubDescription,
    Payments.WksPdThisChk, Payments.CoveredFrom,
    Payments.CoveredTo, Payments.TotWksPaid,
    Payments.RateThisCheck, Payments.ProviderNumber,
    Payments.PayeeName, Payments.Address1,
    Payments.Address2, Payments.VouCheck#,
    Payments.VouchCheck
    FROM Claims INNER JOIN
    Payments ON Claims.Number = Payments.ClaimNumber

    I only want one copy of each record with the data from the two different tables. Just like if this view was a table in itself. Please help!

    Eddie

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

    Post

    Have you tried:

    SELECT Claims.InjuryDate, Claims.ClaimantName, Claims.SS#,
    Claims.LocationCode, Claims.OccupationCode,
    Payments.TypeCode, Payments.Amount,
    Payments.PaymentDate, Payments.StubDescription,
    Payments.WksPdThisChk, Payments.CoveredFrom,
    Payments.CoveredTo, Payments.TotWksPaid,
    Payments.RateThisCheck, Payments.ProviderNumber,
    Payments.PayeeName, Payments.Address1,
    Payments.Address2, Payments.VouCheck#,
    Payments.VouchCheck
    FROM Claims, Payments
    Where Claims.Number = Payments.ClaimNumber and (NOT ISNULL(claims.number))

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