For the life of me I can't join 2 dbf files so that I can get the necessary data I need from the second database.
In my script I have this:
SELECT * FROM ADO CONMANPO_H
The name of the second dbf I need to get data from is called say CONMANPO_D . They field they have in common is called PONO.
I tried this:
LEFT JOIN CONMANPO_H on PONO as CONMANPO_D
However I get a script error when I try running the script.
What am I doing wrong?? I am sure it is something really simple.
Thanks for your help!
See script below. Same issue as I mentioned in my post. I need to get information from ASCONMANPO_D. Common reference is TICKET in this case.
SET TimeFormat='h:mm:ss TT';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
OLEDB CONNECT32 TO [Provider=VFPOLEDB.1;Data Source=k:\QVDATA\;Collating Sequence=general;];
SELECT * FROM ADOCONMANPO_h
LEFT JOIN(ADOCONMANPO_D) ON TICKET
Thanks for your help. Feel silly to have to ask for something so simple.
SELECT adoh.Field1, adoh.Field2, adoh.TICKET, adod.TICKET, adod.fieldname
ADOCONMANPO_h AS adoh
ADOCONMANPO_D AS adod
ON adoh.TICKET = adod.TICKET
When you join the tables try to use Table alias to refer to the fields from their respective tables. Add the fields you want to display in your SELECT list and execute.
Let me know if you get any error?
What do I do if the field in the database does not have the same name?
i.e.: DBF 1 the field is called PONO
DBF 2 the field is called TICKET
Is there a manner to make like an alias for the field so I can use it as a reference to find the data I need?