I have a table with two fields, nombre
and cantidad de productos
, I'm generating an additional field to see the amount of products consumed in 10 months so I'm doing a select
like this:
select nombre, existencia , cast((cantidad/ 10) as decimal(6,2)) from productos
and also ...
select nombre, existencia , convert(decimal (6,2), (cantidad/ 10)) decimal from productos
The problem is that it gives me the whole data and not with decimals, for example like this:
175 / 10 : 17.0
instead of showing it this way 17.5
, where 175
is cantidad
.
What is missing me?