lcSites = addbs(fileloc) + 'bluebook\sites' lcERs = addbs(fileloc) + 'bluebook\ers' select * , ers.name ; from (lcSites) ; left outer join ers on sites.er = ers.er_id ; into cursor crsTempBlueBookwill produce a cursor containing the name of the er taken from the er lookup table. But how do you structure a situation where there are several of these lookups in the main table? As in:
lcSites = addbs(fileloc) + 'bluebook\sites' lcERs = addbs(fileloc) + 'bluebook\ers' lcCEO1 = addbs(fileloc) + 'bluebook\people' lcTC1 = addbs(fileloc) + 'bluebook\people' lcTC2 = addbs(fileloc) + 'bluebook\people' ** yielding something like select * , ers.name, tc1.name, tc2.name, ceo1.name ; from (lcSites) ; (lcERs) as ers ; (lcCEO1) as ceo1 ; left outer join (lcERs) on sites.er = ers.er_id ; left outer join (lcCEO1) on sites.ceo1 = ceo1.person_id etc.Thanks to all for your thoughts
>lcRawData = addbs(fileloc) + "surveys/RawData2005" >rawdata = 'RawData2005' >lcPermID = '20011' >lcJoincondition = 'Companyinfo.company = RawData2005.company' > >SELECT CI.*, RD.* ; > FROM ; > COMPANYINFO CI ; > INNER JOIN (lcRAWDATA) RD ; > on CI.company = RD.company ; > WHERE CI.permid = ( "20011" ) >