field type INT become DECIMAL by database view

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
actarus99
User
Posts: 25

field type INT become DECIMAL by database view

Post 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


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

You can use the CAST as below:

Select ...
CAST(PROD_CODE AS INT)


actarus99
User
Posts: 25

Post 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


Post Reply