2005.01.03 10:35 AM

Rotten %$##@ Access Query

If you create a query that uses a sub-query for the FROM clause and you don't give the sub-query an explicit alias, Access will generate one for you, and the one it generates looks suspiciously like a bad word.

For instance, Access turns this query:

select * from (
  select * from qry_ServiceTreePractices
  union
  select * from qry_ServiceTreeProjects
) 
order by SortKey;

Into this query:

SELECT *
FROM [select * from qry_ServiceTreePractices
  union
  select * from qry_ServiceTreeProjects
]. AS [%$##@_Alias]
ORDER BY SortKey;

Something to keep it in mind before putting it in front of a client.


Comments



Post a Comment

 
  (optional)
  (no html)
 
   


TrackBack

TrackBack URL:  http://www.typepad.com/services/trackback/6a00d8341c7bd453ef00d83541df7469e2

Listed below are links to weblogs that reference Rotten %$##@ Access Query: