You can use a sub query but you can't use it to specify the table name. What exactly are you trying to do with your query?
In addition, even if it did work, the select you're using as the sub query wouldn't be guaranteed to return one field and one record which is what it would need to do in order to be a "tablename".
Doesn't:
SELECT T.Product, SUM(T.Cost), SUM(T.Saving)
FROM Products AS T
GROUP BY T.Product
ORDER BY T.Product
fulfill your needs?
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.