Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Operand data type char is invalid for sum operator

Author  Topic 

braindog
Starting Member

2 Posts

Posted - 2015-03-06 : 12:24:58
can someone help me re-writing the following so I wont keep getting thie baopv ementioned error: here is the statement:

RIGHT('0000000000'+REPLACE(CAST(SUM(PAID_AMT) AS VARCHAR),'.',''),14) AS TOT_NET_PAID


+ RIGHT('0000000000'+REPLACE(CAST(SUM(PAID_AMT) AS VARCHAR),'.',''),14) AS TOT_NET_PAID



It keeps retuning he following error messages:

Operand data type char is invalid for sum operator



some sample data and the expected result from the sample should be like the following:.

0000000002

0000000045

0000001850

0000002736

Thanks

namman
Constraint Violating Yak Guru

285 Posts

Posted - 2015-03-06 : 12:39:57
It is much easier if you provide us sample data and expected result
Go to Top of Page

braindog
Starting Member

2 Posts

Posted - 2015-03-06 : 12:58:14
some sample data and the expected result from the sample should be like the following:.

0000000002

0000000045

0000001850

0000002736
Go to Top of Page
   

- Advertisement -