Farouk,
VFP functions are different from the ones in T-SQL (the language in SQL Server). So you cannot run a query using SQLEXEC() like the one you posted, because T-SQL does not have a DTOS() function. You would have to change it to using DatePart(). The point of SQL Pass-Through is that you pass queries or commands to the back-end database without being processed by VFP. Therefore you have to pass commands or queries that are valid in the language of the back-end.
>>>>>>>>>>>>>>>>>
>Eg. I have a table XYZ with primary key Period and another table ABC with primary key , patient_id and a non key field called visit date. ABC is related through cperiod. My SQL statement goes like this :
>SELECT * FROM XYZ,ABC WHERE LEFT(DTOS(visit_date),6)=cperiod
>Would the above statement works when I upsize to SQL SErver? Else should I create another field cperiod into ABC but then cperiod is fully derivable from visit date and that we're suppose not to have calculated fields in our table.
>>>>>>>>>>>>>>>>>