Hi @Rizal Valry ,
Could you please provide one big data you have?
I tried to insert a new row as below:
insert into coba (nama,jumlah) values
('rizal','120,784,852,841,157,413.000')
I received 'Error converting data type varchar to bigint.' error after executing below query.
select
nama,
sum(cast(replace(jumlah, ',', '') as bigint))
from
dbo.coba
group by nama
The storage of bigint is 8 Bytes and range is -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807).
You could try with decimal(38,2)
instead of bigint.
select
nama,
sum(cast(replace(jumlah, ',', '') as decimal(38,2)))
from
dbo.coba
group by nama
Above is working from my side.
Best regards,
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.