PDA

Click to See Complete Forum and Search --> : help with Views in VB6


Playmaker
Feb 1st, 2000, 12:27 AM
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

Glenn
Feb 2nd, 2000, 05:47 AM
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.

Playmaker
Feb 3rd, 2000, 12:50 AM
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

JHausmann
Feb 3rd, 2000, 01:31 AM
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))