"It doesn't work" is probably the most useless problem report we get - and we get it a lot. It tells us nothing about what is happening, or when it happens.
So tell us what it is doing that you didn't expect, or not doing that you did.
Tell us what you did to get it to happen.
Tell us any error messages.
Help us to help you!
Since you don't tell us where the error occurs (it's on the error message) or what the error is (it's also on the error message) and we have no access to your DB, we have to guess.
And most likely, it's this:
SUM(c.kolicina) AS 'Kol RM',
And treh problem is that the
kolicina
column isn't numeric, and non-numeric columns can't be handled by match functions like SUM.
And that leads to a bigger problem: your DB design is wrong and needs to be changed.
Never store nuymbers in NVARCHAR columns - always use INT, FLOAT, or DECIMAL instead.
If you use the wrong column datatype it's easy to set up, and lazy to get the user data into - but it always gives total nightmares after that - because the data in your DB is not valid, or is not in a consistent format, or is in a different format from that which SQL expects.
Think about it: 10/11/12 is a valid date. But is it 10th Nov 2012, 11th Oct 2012, 12th Nov 2010, or some other value entirely? The only time you can tell is when the user inputs the value, and you use his culture to convert it to a DateTime value - as soon as it arrives in the DB it's too late because you no longer have any idea what date format he used: it could be US: MM/DD/YY, European: DD/MM/YY, or ISO / Japanese YY/MM/DD - and you don't even know that the user is using the same calendar as you so the year could be well different (the Hijri date today is Jumada Al-Awwal 3, 1438)! Or even that he didn't enter "hello, my name is Jackie" which isn't even close to a date.
So when you try to convert it to a date at a later time you are almost guaranteed to get errors because the SQL server will try to convert it using it's culture - and generally you don't even know what culture the server is set to!
And you get the same problems when you store numbers as strings as well: they have to be converted every time you want to use them, they can be in the "wrong format" because the user that entered them uses Indian numbering instead of US: "2,31,50,000" instead of "23,150,000", or German: "23 150 000". Or the field may contain "Hello world" through a coding error or a lack of validation.
Always use appropriate data types - it may be easier for your code to slam in NVARCHAR all the time, but it wastes huge amounts of effort later fixing up the holes it leaves.