Hello, I have the following query in which I need help with the substring join:
select
x.labtest_key,
x.ng_labtest_key,
x.labtest_desc
ng_labtest_desc
from
lab_tests_tbl x LEFT OUTER JOIN lab_tests_mstr_tbl m ON x.ng_labtest_key = m.ng_labtest_key
LEFT OUTER JOIN up_ex_data_xref u ON substring(u.input_param, 2, len(u.input_param) - 2) = x.ng_labtest_key
I throws the following when run:
Msg 536, Level 16, State 5, Line 1
Invalid length parameter passed to the SUBSTRING function.
Is there a way around this?
Thank you,
David