Using the EXCEPT keyword in Jet queries

  • Thread starter Nathan Sokalski
  • Start date
N

Nathan Sokalski

I have an SQL query that is as follows:

SELECT headline,url,summary,updated FROM worldnews EXCEPT (SELECT
headline,url,summary,updated FROM worldnews WHERE newssection='Archives'
UNION SELECT TOP 5 headline,url,summary,updated FROM worldnews WHERE
newssection='Archives' UNION SELECT TOP 5 headline,url,summary,updated FROM
worldnews WHERE newssection='Main') ORDER BY displayorder DESC

When I test it using Microsoft Access 2003 it tells me there is a syntax
error in the FROM clause. I tried executing everything inside the ()'s
separately, which worked correctly, so I believe that the part causing the
error is the EXCEPT keyword. Does Access not support the EXCEPT keyword (I
am actually executing it through Jet using an ASP.NET application, but I
designed the *.mdb file using Access 2003)? The ASP.NET application gives
the following error:

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

The following query, which uses the same fields and tables, works with no
problems:

SELECT TOP 5 headline,url,summary,updated FROM worldnews WHERE
newssection='Main' ORDER BY displayorder DESC

Does anybody have any ideas what might be the problem? Thanks.
 
U

Uri Dimant

Nathan
I think you will be better of asking ACCESS group to answer the question.
 
Top