Query

  • Thread starter Thread starter Prashanta
  • Start date Start date
P

Prashanta

Actually I am trying out the following query in Access 97
for the Northwind database(default databse in Access)

SELECT [CategoryName] FROM ([Categories] INNER JOIN
(SELECT distinct(CategoryID) FROM [Products]) as T ON
[Categories].[CategoryID] = T.[CategoryID]);

I am getting "Synatx Error in From Clause" as error...

But, the same query is working correctly in Access 2000
databse....Can Any one knows this Why is this happening..
I want to use similar kind of query for my application..


Regards
 
Actually I am trying out the following query in Access 97
for the Northwind database(default databse in Access)

SELECT [CategoryName] FROM ([Categories] INNER JOIN
(SELECT distinct(CategoryID) FROM [Products]) as T ON
[Categories].[CategoryID] = T.[CategoryID]);

I am getting "Synatx Error in From Clause" as error...

But, the same query is working correctly in Access 2000
databse....Can Any one knows this Why is this happening..
I want to use similar kind of query for my application..

The sequence of joining to a Subquery is supported in Access200x, but
was not supported in Access97 - except for an undocumented trick
(which I learned from John Viescas): Try

SELECT [CategoryName] FROM ([Categories] INNER JOIN
[SELECT distinct(CategoryID) FROM [Products]]. as T ON
[Categories].[CategoryID] = T.[CategoryID]);

Note the *square brackets* and the period delimiting the subquery.
 
Back
Top