Hi
Incorrect Syntax near ""
CASE
WHEN T1."TransType" = '13' THEN (Select max(A0.CardCode") from ONV A0 where A0."TransId" = T1."TransId")
WHEN T1."TransType" = '14' THEN (Select max(A0."LocCode") from ORIN A0 where A0."TransId" = T1."TransId")
End As "Vendor"
Thanks
Sangeetha SPosted Mar 25, 2025, 7:09 AM
Let's correct it:
Sophia CarterPosted Mar 25, 2025, 5:31 AM
Hi there! It looks like the issue in your SQL query is around the incorrect syntax near the quotation mark in your subqueries. Specifically, in the lines:
The problem lies with the ending quotation mark in `A0.CardCode"` and the missing backtick in the `Select max(A0."LocCode")` part of your subqueries.
To correct the syntax, you should adjust these lines to:
By making these adjustments, you'll have properly formatted subqueries, and your SQL should execute without syntax errors.
If you have any more questions or need further clarification, feel free to ask!