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

Need to join a field from another table, i am getting an error, can anyone help please

Status
Not open for further replies.

titoneon

MIS
Dec 11, 2009
335
US
using vfp 9.0 sp2
something is going wrong with my code.
I have two tables each of them located in different drive letters and table1, have most of the field i need and the other table2 has one of the field, that the first table does not have, both tables have one field in common and i need based on those fields in common to get the data from a field from the second table, here is what i wrote and i get this error, "object T2 is not found" please correct me, here is my select sql and the path where each table resides in in the select sql.

NOTE: THE two common fileds are ball_no, i need to get from table2 the value of part_type and be able to display in the grid.

lcjob="120072"

table1 = POTRAN04 it is a vfp table
TABLE2 = ENG_JOBS it is a foxpro dos table

Code:
Select t1.INT(VAL(dept)) as ball_no, t1.INT(QtyOrd) as QTYORD, t1.INT(Qtyrec) as QTYREC, t2.part_type, t1.item as ItemNo, t1.vpartno as vendorpartno, ;
t1.descrip, t1.Recdate, t1.purno;
From S:\PRO50\APEX04\potran04 t1;
INNER Join f:\mfg\eng_jobs t2;
ON t2.INT(VAL(ball_no)) = t1.INT(VAL(dept));
WHERE t1.reqno= lcJob_no;
INTO Cursor junkjob

Thanks a lot in advance
 
Hi Mike,
yes, instead of

Select t1.INT(VAL(dept)) as ball_no,

it should be "Select INT(VAL(t1.dept)) as ball_no,.." and so on

Thanks for the rescue Best
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top