Page 1 of 1

field type INT become DECIMAL by database view

Posted: Sat Dec 03, 2022 1:11 am
by actarus99

Hi, I have a table with a field INT.

I created a view where I calculate the sum of this field.
For the view the field is data type DECIMAL. Why? How can I mantain the same field type INT?
Tnx


Re: field type INT become DECIMAL

Posted: Sat Dec 03, 2022 3:44 am
by mpol_ch

You can use the CAST as below:

Select ...
CAST(PROD_CODE AS INT)


Re: field type INT become DECIMAL by database view

Posted: Sat Dec 03, 2022 4:19 pm
by actarus99

Tnx mpol_ch,
I solved working on 'format pattern' of the field.
As data type DECIMAL I couldn't make right operations like additions or subtractions because the dot (thousands separator) was interpreted as a comma. So, removing the decimals solved the problem.
Tnx