My actual experience in doing this was limited & is several months behind me, but I do recall that in the transfer of dates between Fox and Sql you will need to make special consideration for empty dates on the fox side. Perhaps experiment & see how they come across & then make provisions accordingly.
Perhaps as a first step, pass some hard coded values to insure everything works correctly, and then step back to properly building the string to pass to your sproc.
>There's no need to cast, however, when you use DTOC() results can vary depending on the SET DATE TO setting and the date setting SQL Server is using, specially when working with OS and Server in different languages or with different local settings. When in need to send a date to sql server I always use DTOS() to convert dates, that way the server will transform the date to whatever setting it's using.
>
>HTH
>
>
>>I am running SQL Server 2000 and am using SQLEXEC() to pull recordsets from SQL. I want to pass two date parameters from VFP7 to SQL using SQLEXEC but I don't get any data back. Here is my syntax on the VFP side:
>>
>>nRetVal = SQLEXEC(nConn,"EXEC usp_StoredProc '"+ALLT(DTOC(dDate1))+"' '"+ALLT(DTOC(dDate2))+"'",'cursor1')
>>
>>Within my SQL sp I have a @dDate1 DATETIME, @date2 DATETIME declared.
>>
>>Do I need to somehow CAST the VFP dates to DATETIME?
Paul A. Busbey
Victoria Insurance