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

Output is not Correct

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi,

I am using sql-select as shown below:

Code:
SELECT Lamjobmain.jono, Lamjobmain.lamdate, Lamjobmain.pcode,;
  Customer.full_name, Lamjobmain.rcode, Rcode.jobname, Lamjobmain.quantity,;
  Lamjobsub.passno, Lamjobsub.rawcode,;
  Rawcode.full_desc, Lamjobsub.qntyin,;
  Lamjobsub.scode, Supplier.full_name ;
 FROM ;
     village!lamjobmain ;
    INNER JOIN village!lamjobsub ;
   ON  Lamjobmain.jono = Lamjobsub.jono ;
    INNER JOIN village!supplier ;
   ON  Lamjobsub.scode = Supplier.pcode ;
    INNER JOIN village!rawcode ;
   ON  Lamjobsub.rawcode = Rawcode.rawcode ;
    INNER JOIN village!customer ;
   ON  Lamjobmain.pcode = Customer.pcode ;
    INNER JOIN village!rcode ;
   ON  Lamjobmain.rcode = Rcode.rcode;
 INTO CURSOR LamQuery READWRITE NOFILTER

LamJobMain Contains 1 Record
LamJobSub Contains 23 records
Customer contains more than 1000+ records
Supplier contains more than 500+ records
Rawcode contains more than 1000+ records
rcode contains more than 1000+ records

After running this query it displays only 14 records.
In Lamjobsub few records contains empty(rawcode).
How can I display all 23 reccords?

Thanks

Saif
 
You make inner joins, you only get data, if all match conditions are met.
If not all 23 subjobs are subjobs of the one mainjob, you don't get all 23 records, as simple as that.

So look at this:
What is Lamjobmain.jono of the 1 record you have there?
What is Lamjobsub.jono of the 23 records in that table?

Bye, Olaf
 
You want to select from the table you want to survive. You might want to use a left outer join. It would seem to me your main table might be customer.

Just wondering are you working against a DBF or and MSSQL table?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top