Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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


Result query is

UKUPNObpdv  UKUPNOpdv  UKUPNOsapdv
   132.00     22.44      255.06


What I have tried:

SELECT SUM(isnull(cast(REPLACE(TRY_CONVERT(float,TRY_CONVERT(float,iznos_bpdv),1), '#,0.00','')AS decimal(10,2)),0.00)) as UKUPNObpdv,  
SUM(isnull(cast(REPLACE(TRY_CONVERT(float,TRY_CONVERT(float,pdv),1), '#,0.00','')AS decimal(10,2)),0.00)) as UKUPNOpdv,  
SUM(isnull(cast(REPLACE(TRY_CONVERT(float,TRY_CONVERT(float,iznos_sa_pdv),1), '#,0.00','')AS decimal(10,2)),0.00)) as UKUPNOsapdv  
from mp_racun_roba  
where tip_robe='Roba (Generalno)' and id_fakture='34'  
Posted
Comments
Er. Puneet Goel 1-Jun-18 5:27am    
Goran, your question is a little bit unclear, can you please present it another way.
Goran Bibic 1-Jun-18 5:34am    
What is not clear? have query and query result. I need query result to multiple with column quantity(kolicina)? What is not clear?
Mohibur Rashid 1-Jun-18 5:42am    
Goran, Puneet is trying to be helpful. It's your job to ask clear question to get clear answer. Arrogance is not going to help.
Goran Bibic 1-Jun-18 5:57am    
Soryy...I just need to multiple result query with column quantity
CHill60 1-Jun-18 9:49am    
It looks as if you are storing numeric values in text-type columns. Change the column to an appropriate type such as numeric, double, float etc.
Can you supply the table schema and some sample data from your table

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900