Steve-vfp9user
Programmer
Hello all
I have two tables MEMBERS and LKPJTYP
The MEMBERS table holds relevant data and the LKPJTYP table holds information about courses linked to members. The link URN between both tables is MEMBERID.
I am trying to create an SQL statement so I can link the members records to their respective courses by the MEMBERID which is a numeric field as is the MEMBERS dbf field.
The above provides a blank database but once it's correct I would then move on to the below.
Can anyone please suggest what I'm doing wrong with the SQL.
Thank you
Steve Williams
I have two tables MEMBERS and LKPJTYP
The MEMBERS table holds relevant data and the LKPJTYP table holds information about courses linked to members. The link URN between both tables is MEMBERID.
I am trying to create an SQL statement so I can link the members records to their respective courses by the MEMBERID which is a numeric field as is the MEMBERS dbf field.
Code:
Select * From MEMBERS WHERE MEMBERID In (Select MEMBERID From LKPJTYP Where LKPJTYP.MEMBERID=MEMBERS.MEMBERID) ;
INTO TABLE tempinsert+'dbf'
The above provides a blank database but once it's correct I would then move on to the below.
Code:
USE tempfile+'.dbf' EXCLUSIVE
COPY TO myfile FIELDS TITLE, FORENAME1, SURNAME, ADD01, ADD02, ADD03, ADD04, ADD05, ;
POSTCODE, EMAIL, PROJECTDES TYPE XLS
CLOSE DATABASES
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
cFileName = "\rsvpdms\"+mcsvfile
cAction = "open"
ShellExecute(0,cAction,cFileName,"","",1)
Can anyone please suggest what I'm doing wrong with the SQL.
Thank you
Steve Williams