>>Your conclusion is incorrect because SQL Server doesn't work the way you described. The Query Optimizer analyzes whole query and decides how execute it. As I mentioned in the previous message ( I guess you missed it)
Recent article in SQL Server magazine showed that this select generates the same execution plan as your query.
>
>Ok, adding the temporary cursor name does it. I also put the entire syntax that I need and that works great:
>
>
>SQLExec(lnHandle,'SELECT Year,Month FROM (SELECT YEAR(AddDate) AS Year,'+;
> 'MONTH(AddDate) AS Month FROM News) Temp GROUP BY Year,Month')
>
I'm glad you got it to work. It's unfortunate that VFP doesn't support derived tables so you could use the same queries for both backends.
--sb--