cSql = "Select EmpMst.EmpName As Name,EmpAtt.EmpDate As Date," + ; " EmpAtt.EmpAtt As AttHrs,EmpAtt.EmpRate As Rate" + ; " From BetaSql.dbo.EmpMst,BetaSql.dbo.EmpAtt" + ; " where Len(EmpMst.EmpCode) > 0 and EmpMst.Empcode = ?cEmpCode" + ; " And EmpMst.EmpCode = EmpAtt.EmpCode"Since you are in VFP8 you might want to look at using the newer TEXT commands:
text to cSQL noshow Select EmpMst.EmpName As Name,EmpAtt.EmpDate As Date, EmpAtt.EmpAtt As AttHrs,EmpAtt.EmpRate As Rate From BetaSql.dbo.EmpMst,BetaSql.dbo.EmpAtt where Len(EmpMst.EmpCode) > 0 and EmpMst.Empcode = ?cEmpCode And EmpMst.EmpCode = EmpAtt.EmpCode endtext ? cSQLThis has the benefit that you can copy/paste the SQL statement between a tool like Query Analyzer and VFP.