>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')