Hi,
I am trying to join 2 tables together but once column is a text, and the other nvarchar and as a result, I get the following error message
Msg 402, Level 16, State 1, Line 101
The data types text and nvarchar are incompatible in the equal to operator.
Any idea how I can get around this please?
This is my code:
select
a.cust_no,
a.dept_issue,
a.dept_code as dept_code,
b.name as dept_name
from [table].[dbo].[Dept] as a
left join [table].[dbo].[MTP] as b
on a.dept_code = substring(b.dept_code,3,6)