So I'm having a problem with a query, and I don't really understand where. A comment is placed where the syntax error is. The query is much larger, I tried to shorten it to make a valid but tidier query.
This is using odbc to connect to a Progress database. I'm told it uses strict SQL-92.
SELECT itemcust."item-cust",
itemcust."cust-no",
corptreeCust.code
FROM pub."item-cust" itemcust
JOIN pub.customer cust
left join pub.salesstructcustomer struct
on ( struct."corp-cust-type" = cust."corp-cust-type"
and struct."corp-cust-num" = cust."corp-cust-num"
)
left join pub.corptree corptreeCust
on ( corptreeCust.uid = struct.corptreeid /* program says SQL Syntax error here */
and corptreeCust.category = 'store'
)
where ( itemcust."in-entity" = {$entity} or itemcust."in-entity" = '*')
and itemcust."item-no" = {$itemno}
and ( itemcust."cust-no" = {$custno} or itemcust."cust-no" = '*')
and cust."cust-no" = {$custno}
Thanks!
Your table alias for pub.salesstructcustomer is struct, not structc as referenced in the join.
Is that a typo? Looks like it's looking at structc instead of struct, unless I missed something.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With