Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Msg 8114, Level 16, State 5, Line 2 Error converting data type

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading