Hi Michael,
Perhaps I'm reading it wrong but it seems to me that you'll only ever have one record returned if you're looking for the MIN() of a primary key.
lcSQL = "Select News.Numero, News.CustomerName From News Where Numero In " + ;
"(Select Min(News.Numero) From News Where Priority)"
lnQueryResult = SQLExec(lnConnectionHandle, lcSQL, "curResults")
Regards,
Liam
>I need to convert two VFP SQLs into SQLExec(). What I have presently in VFP is one SQL which collects all primary keys from a table. Then, from that cursor, I extract all the necessary fields from the table by the use of a inner join. So, I have something like:
>
>
>SELECT MIN(News.Numero) AS Numero FROM News WHERE Priority INTO CURSOR Temp
>
>SELECT News.Numero,News.CustomerName FROM Temp;
> INNER JOIN News ON Temp.Numero=News.Numero INTO CURSOR Temp
>
>
>Basically, how can I achieve the same from a SQL Server table by the use of SQLExec()?
Liam O'Hagan
MCP VFP Desktop Apps