Union Query Error

P

PPCO

I am using an union query to combine 2 queries. My SQL is this so far:

SELECT [shipdate], [CustomerRefFullName]
FROM [qrysalesorder]

UNION ALL SELECT [shipdate], [CustomerRefFullName]
from [qryinvoiceline];

I am using this with an ODBC program that is pulling info from our
accounting software.

The error I'm getting is this:
"ODBC--CALL FAILED
[ODBC] Expected Lexical Element not found: <keyword> (#11015)

Any ideas why it might be doing this?
 
T

Tom Ellison

Dear PP:

You are accessing two queries. Do these work in your front end? Are they
in your front end, or are they linked?

Break it into pieces:

1. break the union apart and test the pieces

2. check that the queries and tables that make up this are each available

The solution will be specifically in the component(s) that fail(s).

Tom Ellison
 
P

PPCO

Yes, the queries do work by themselves, if that's what you mean by front end.
I have tried each component by itself and they both work.
I'm wondering if I should just skip the queries that I'm trying to link (I
had several filters because I'm dealing with a ton of info with my ODBC
program) and go back to the original tables and use the union query for that
then a make-table query.
We'll see what happens...

Tom Ellison said:
Dear PP:

You are accessing two queries. Do these work in your front end? Are they
in your front end, or are they linked?

Break it into pieces:

1. break the union apart and test the pieces

2. check that the queries and tables that make up this are each available

The solution will be specifically in the component(s) that fail(s).

Tom Ellison


PPCO said:
I am using an union query to combine 2 queries. My SQL is this so far:

SELECT [shipdate], [CustomerRefFullName]
FROM [qrysalesorder]

UNION ALL SELECT [shipdate], [CustomerRefFullName]
from [qryinvoiceline];

I am using this with an ODBC program that is pulling info from our
accounting software.

The error I'm getting is this:
"ODBC--CALL FAILED
[ODBC] Expected Lexical Element not found: <keyword> (#11015)

Any ideas why it might be doing this?
 
P

PPCO

Ok, I tried combining the original tables, and it gives me the same error
message. It seems that it is a problem with the union query and the ODBC
program as all of my queries work fine, and it doesn't matter which fields I
try--I still get the same error. Anybody know anything about getting union
queries to work with an ODBC program? Thanks!

PPCO said:
Yes, the queries do work by themselves, if that's what you mean by front end.
I have tried each component by itself and they both work.
I'm wondering if I should just skip the queries that I'm trying to link (I
had several filters because I'm dealing with a ton of info with my ODBC
program) and go back to the original tables and use the union query for that
then a make-table query.
We'll see what happens...

Tom Ellison said:
Dear PP:

You are accessing two queries. Do these work in your front end? Are they
in your front end, or are they linked?

Break it into pieces:

1. break the union apart and test the pieces

2. check that the queries and tables that make up this are each available

The solution will be specifically in the component(s) that fail(s).

Tom Ellison


PPCO said:
I am using an union query to combine 2 queries. My SQL is this so far:

SELECT [shipdate], [CustomerRefFullName]
FROM [qrysalesorder]

UNION ALL SELECT [shipdate], [CustomerRefFullName]
from [qryinvoiceline];

I am using this with an ODBC program that is pulling info from our
accounting software.

The error I'm getting is this:
"ODBC--CALL FAILED
[ODBC] Expected Lexical Element not found: <keyword> (#11015)

Any ideas why it might be doing this?
 

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

Top