Home > Archive > dBASE Web Applications > April 2005 > join not working right









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author join not working right
Dan Anderson

2005-04-04, 8:03 pm

db+ I am trying to join two tables, "PennAm1.dbf" which is the master file
and "Apcustom.dbf" which is a much larger file that contains data related to
the master records. In particular, "apcustom.db" contains a column titled
"Data1." I have determined that there is a record in Apcustom.dbf for every
record in PennAm1.dbf. However, some of the records in the joined table,
"unit1.dbf", have blank data1 fields. Below is my code. What is wrong and
how can I get it to match every record?


query1 = new query()
query1.sql = 'SELECT * ' + ;
'FROM "PennAm1.dbf" PA ' + ;
'LEFT OUTER JOIN "APCUSTOM.dbf" AP ' +;
'ON (PA.POL_IDX = AP.POL_IDX)' +;
'ORDER BY POL_IDX'

query1.active = true

u = new UpdateSet()
u.source = query1.rowset
u.destination = " K:\applications\PA\U
NIT1.dbf"
u.copy()
--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101


Silvio Genco

2005-04-04, 8:03 pm

Try this
query.sql = "SELECT PennAm1*, APCUSTOM.* ;
FROM PennAm1 PA LEFT OUTER JOIN;
APCUSTOM AP ON (PA.POL_IDX = AP.POL_IDX);
ORDER BY PA.POL_IDX"

Silvio

> query1 = new query()
> query1.sql = 'SELECT * ' + ;
> 'FROM "PennAm1.dbf" PA ' + ;
> 'LEFT OUTER JOIN "APCUSTOM.dbf" AP ' +;
> 'ON (PA.POL_IDX = AP.POL_IDX)' +;
> 'ORDER BY POL_IDX'
>
> query1.active = true
>
> u = new UpdateSet()
> u.source = query1.rowset
> u.destination = " K:\applications\PA\U
NIT1.dbf"
> u.copy()
> --
> Dan Anderson
> UBI Processing Dept.
> andersond@ubinc.com
> 800-444-4824 ext 101
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com