[AccessD] Undocumented Access SQL syntax - Derived tables

Paul Rodgers Paul.Rogers at SummitMedia.co.uk
Fri Jul 30 02:35:03 CDT 2004


Brilliant, Michael. Thanks very much. (If you're prepared to divulge the url
sometime, be very pleased to use it.) Cheers paul 

-----Original Message-----
From: Michael Maddison [mailto:michael at ddisolutions.com.au]
Sent: Friday, July 30, 2004 5:15 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Undocumented Access SQL syntax - Derived tables


Hi list,

I've been mainly working in SQL 2K for a while now and have grown to
love using derived tables in my sql statements.  A shame you can't do
the same in Access! You thought so, well so did I.  A colleague came
across a website (no link,sorry) which shows how to do derived tables in
MS Access.

Undocumented Syntax
SELECT .* 
FROM
[SELECT sum(x) FROM FOO]. BAR

***Notice the [] and the space after the .

This works like a charm, even the query designer likes it!  The only
drawback I've found (apart from being undocumented)
is the derived tables cannot have column names with square brackets
arround them.
So 
	SELECT .* 
	FROM
	[SELECT sum([My Badly Named Field]) FROM FOO]. BAR
Will not parse correctly.

Try it out.

cheers

Michael M
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list