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
 
Back
Top