hi there,
i'm trying to perform a union using the following SQL:
this complains of the error:
this only happened when I changed a value in the 2nd select from CLARITYHistory.PREXTERNALID to CLARITYHistory.EXTERNAL_ID.
can anyone tell me what might be happening.
shall I just use a convert function as the error message suggests?
can anyone tell me how.
thanks in advance,
Matt
i'm trying to perform a union using the following SQL:
Code:
Select ATEHistory.DepartCode, ATEHistory.TransDate, ATEHistory.Client+' - '+ ATEHistory.clntname, rtrim(ATEHistory.lastname)+', '+rtrim(ATEHistory.firstname),rtrim(ATEHistory.EmplyCode), ATEHistory.description, ATEHistory.Quantity from dbo.ATEHistory
UNION ALL
SELECT SUBSTRING(CLARITYHistory.DEPARTCODE, 3, 4), CLARITYHistory.PRSTART, CLARITYHistory.CUSTOMER_CODE+' - '+CLARITYHistory.CUSTOMER, CLARITYHistory.LAST_NAME+', '+CLARITYHistory.FIRST_NAME+' - '+CLARITYHistory.EXTERNAL_ID, CLARITYHistory.LOCATION, CLARITYHistory.ACTUALS FROM dbo.CLARITYHistory
this complains of the error:
Code:
Server Message: Number 257, Severity 16
Server 'dst_test', Line 1:
Implicit conversion from datatype 'TEXT' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query.
this only happened when I changed a value in the 2nd select from CLARITYHistory.PREXTERNALID to CLARITYHistory.EXTERNAL_ID.
can anyone tell me what might be happening.
shall I just use a convert function as the error message suggests?
can anyone tell me how.
thanks in advance,
Matt