Help with Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the below query and I get the below error message. For the life of me
I can not figure it out. Any help would be greatly appreicated.

Query:
SELECT 810_HEADER.*, 810_DETAIL.*, 810_SAC.* FROM 810_HEADER INNER JOIN
810_DETAIL ON [810_HEADER].PONUM = [810_DETAIL].PONUM INNER JOIN 810_SAC ON
[810_HEADER].PONUM = [810_SAC].PONUM WHERE [810_HEADER].STATUS='1' AND
[810_DETAIL].QTYINVOICED>'0'

Error Message:
Syntax error (missing operator) in query expression '[810_HEADER].PONUM =
[810_DETAIL].PONUM INNER JOIN 810_SAC ON [810_HEADER].PONUM = [810_SAC]PONUM'.
 
You need to parenthesise the first JOIN:

SELECT 810_HEADER.*, 810_DETAIL.*, 810_SAC.*
FROM (810_HEADER INNER JOIN 810_DETAIL
ON [810_HEADER].PONUM = [810_DETAIL].PONUM)
INNER JOIN 810_SAC ON [810_HEADER].PONUM = [810_SAC].PONUM
WHERE [810_HEADER].STATUS='1'
AND [810_DETAIL].QTYINVOICED>'0';

I see you've delimited the Status and QtyInvoiced values with quotes. Are
they really text data types?

Ken Sheridan
Stafford, England
 
Thanks Ken, that worked. Yes unfortunatly the Status and QTYINOVICED are
text fields. Thank you very much for the hlep.

Ken Sheridan said:
You need to parenthesise the first JOIN:

SELECT 810_HEADER.*, 810_DETAIL.*, 810_SAC.*
FROM (810_HEADER INNER JOIN 810_DETAIL
ON [810_HEADER].PONUM = [810_DETAIL].PONUM)
INNER JOIN 810_SAC ON [810_HEADER].PONUM = [810_SAC].PONUM
WHERE [810_HEADER].STATUS='1'
AND [810_DETAIL].QTYINVOICED>'0';

I see you've delimited the Status and QtyInvoiced values with quotes. Are
they really text data types?

Ken Sheridan
Stafford, England

Alan said:
I have the below query and I get the below error message. For the life of me
I can not figure it out. Any help would be greatly appreicated.

Query:
SELECT 810_HEADER.*, 810_DETAIL.*, 810_SAC.* FROM 810_HEADER INNER JOIN
810_DETAIL ON [810_HEADER].PONUM = [810_DETAIL].PONUM INNER JOIN 810_SAC ON
[810_HEADER].PONUM = [810_SAC].PONUM WHERE [810_HEADER].STATUS='1' AND
[810_DETAIL].QTYINVOICED>'0'

Error Message:
Syntax error (missing operator) in query expression '[810_HEADER].PONUM =
[810_DETAIL].PONUM INNER JOIN 810_SAC ON [810_HEADER].PONUM = [810_SAC]PONUM'.
 

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