Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

SUM return zero in SQL on a string datatype column

$
0
0

I have a column that stores an amount as a varchar. However, I am converting it on below query to decimal as below:

select top 100 cast(amount as decimal(16,4)) amount, *from src.bc_sales_invoice_linewhere document_no = '23005986'

But I need to get the sum of the column and tried on below query:

enter image description here

But it is returning zero

I need to get the sum of amount on the varchar column. any helps?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>