all groups > sql server programming > june 2007 >
You're in the

sql server programming

group:

Using the EXCEPT keyword in Jet queries


Using the EXCEPT keyword in Jet queries Nathan Sokalski
6/6/2007 10:42:24 PM
sql server programming: 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.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

Re: Using the EXCEPT keyword in Jet queries Uri Dimant
6/7/2007 12:00:00 AM
Nathan
I think you will be better of asking ACCESS group to answer the question.


[quoted text, click to view]

AddThis Social Bookmark Button