>IF !EMPTY(thisform.c_WhereFilt) > lcWhere = 'WHERE ' + thisform.c_WhereFilt && built in another method >ELSE > lcWhere = '' >ENDIF > >IF !EMPTY(thisform.c_AnsFields) > lcAnsFields = thisform.c_AnsFields && built in another method >ELSE > lcAnsFields = '' >ENDIF > > >* set the join condition based on the user selection >DO CASE > CASE thisform.l_AllTestPoints > lcTstAnsJoin = 'LEFT OUTER JOIN ' > CASE thisform.l_ReadingOnly > lcTstAnsJoin = 'INNER JOIN ' > OTHERWISE > lcTstAnsJoin = 'INNER JOIN ' >ENDCASE > >lcSelCursor = sellist() && get the select cursor name > >SELECT tst.*, ; > &lcAnsFields ; > tsf.location, ; > tsf.equation, ; > tsf.legal ; > FROM tstpoint tst ; > INNER JOIN tstfac tsf ; > ON &gcTsfTstJn ; && constant define join condition > (lcTstAnsJoin) ansurvey ans ; > ON &gcTstAnsJn ; && constant define join condition > INNER JOIN nodes nde ; > ON nde.ndesyscode = tsf.sys_code ; > INNER JOIN &lcSelCursor sel ; > ON tsf.sys_code + tsf.pipe = sel.sys_code + sel.pipe ; > <b>&lcWhere</b> ; >INTO CURSOR cAnsreads NOFILTER>