Problems with Unions SQL statement in Access trough the ODBC driver

  • Thread starter Thread starter Javier de la Torre
  • Start date Start date
J

Javier de la Torre

Hi all,

I'm wondering if someone has experiment problems using SQL statements with
UNIONS trough the ODBC driver. For example this SQL statement:

(SELECT DISTINCT compactes.numplec AS UnitId
FROM compactes)

UNION

(SELECT DISTINCT plecs.numplec AS UnitID
FROM plecs)

If I execute this inside Access it works perfectly, but if I execute it from
and ASP web page trough the ODBC driver it doesn't work.

Do you have any idea what is going on?

Thanks in advance.

Javier.
 
remove () from the statements they are not SQL compliant
ie
SELECT ... FROM A
UNION
SELECT ... FROM B

HTH

Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top