User-1651604128 posted
Hi,
I have this SQL statement converted from an vb.net classic app to mvc C# web app,
SELECT
CASE
WHEN table1.ID
is
not
null
then tabl2.PLA_NAME
+
', '
+ table1.D_ID
+
', '
+ table1.ID
else table2.A_NAME
+
', '
+ table1.D_ID
END table3.A_ID,
table3.ID,
cast([table3].[A_ID]
as
nvarchar)
+
cast([table3].[ID]
as
nvarchar)
FROM table1
INNER
JOIN
(table3
INNER
JOIN table2
ON table3.A_ID
= table2.A_ID)
ON table1.ID
= table3.ID
ORDER
BY table2.A_NAME,
table1.D_ID, table1.ID
the above code works on the vb.net application, but I got compile time error when run it in sql server management studio
"The multi-part identifier "table1.ID" could not be found" on each table highlighted in red above.
Appreciate any input, thanks a lot,
Edit, after some searching, found this solution:
https://radacad.com/fixing-the-error-the-multi-part-identifier-could-not-be-bound-in-join-statements
but I still can not fix my above codes, any help is appreciated,