Goran Bibic

Goran Bibic

  • 455
  • 2.9k
  • 178k

Multiply columns MS SQL

Jun 1 2018 3:51 AM
Query is ok
 
In table mp_racun_roba (down in query) i have column name kolicina
 
1) I need to multiply this three column with kolicina
2) In sum column if have value with thousand separator not sum (example 1,644.00) just jump that value
 
  1. SELECT SUM(isnull(cast(REPLACE(TRY_CONVERT(float,TRY_CONVERT(float,iznos_bpdv),1), '#,0.00','')AS decimal(10,2)),0.00)) as UKUPNObpdv,  
  2. SUM(isnull(cast(REPLACE(TRY_CONVERT(float,TRY_CONVERT(float,pdv),1), '#,0.00','')AS decimal(10,2)),0.00)) as UKUPNOpdv,  
  3. SUM(isnull(cast(REPLACE(TRY_CONVERT(float,TRY_CONVERT(float,iznos_sa_pdv),1), '#,0.00','')AS decimal(10,2)),0.00)) as UKUPNOsapdv  
  4. from mp_racun_roba  
  5. where tip_robe='Roba (Generalno)' and id_fakture='34' 

Answers (4)