Can you help me to do this view correctly?
code:
SELECT CustomerName, C_CUR, SUM(BILL_AMT) AS B_AMT, C_CODE
FROM dbo.BILLS
WHERE (BILL_TYPE = 2)
GROUP BY C_CODE, C_CUR, CustomerName
UNION ALL
SELECT C_CODE, SUM(BILL_AMT) AS RT_AMT, C_CUR, CustomerName
FROM dbo.RTN_BILLS
WHERE (BILL_TYPE = 2)
GROUP BY C_CODE, C_CUR, CustomerName
error:
Msg 8114, Level 16, State 5, Line 2
Error converting data type nvarchar to float.
>Solution :
List the columns for both parts of the UNION in the same order.