>lcPath = [K:\FAS\] >lcPathSoMain = lcPath+[SoMain] >lcPathSosUb = lcPath+[SosUb] >lcPathPCode = lcPath+[PCode] >lcPathIcode = lcPath+[Icode] > >SELECT SoMain.*, SosUb.ICode, SosUb.qntymaj, SosUb.qntymin,; > SosUb.RateMaj, SosUb.RateMin,; > PCode.full_Name, pcode.address, pcode.tel1, pcode.tel2, pcode.tel3, ; > Icode.full_desc, icode.unit ; > FROM (lcPathSoMain); > RIGHT JOIN (lcPathSosUb) ON SoMain.SoNo == SosUb.SoNo; > LEFT JOIN (lcPathPCode) ON SoMain.PCode == PCode.PCode; > LEFT JOIN (lcPathIcode) ON SosUb.Icode == Icode.Icode; > WHERE BETWEEN(SoMain.date, dt1, dt2) INTO CURSOR cSomain >