Thousand decimal point problem

  • 247 Views
  • Last Post 29 December 2018
Stylus STYLUS posted this 29 December 2018

My code is ok, but if have values from 0 to 999 it's ok. Example two values 500.00 and 80.00 result is 580.00 that is ok. Example if have two values 1,000.00 and 100.00 sum result is 100.00  

select kupac as 'Kupac',
SUM(TRY_CONVERT(Decimal(10, 2), ISNULL(NULLIF(iznos_sa_pdv, ''), '0'))) AS 'UKUPNO'   
from(select kupac, iznos_sa_pdv from mp_faktura_lista union all select kupac, iznos_sa_pdv from mp_racun_lista) as alltables  
group by kupac  

  Some help?

admin posted this 29 December 2018

I think you should increase length of your decimal type

For example

TRY_CONVERT(Decimal(18, 2), ISNULL(NULLIF(iznos_sa_pdv, ''), '0'))
Close