We help IT Professionals succeed at work.

How to adjust scale of computed column in SQL

Hi,
I have a decimal 18,2 and another 8,2 which i have a computed column for the total
(qty * cost).

The scale of the computed column is 4. I want it to be 2. Or is it not an issue becuase the other two columns are scale of 2 and 2? Issue is half pennies...creating display issues for users...

Thanks.
Comment
Watch Question

Chief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011
Commented:
You should do an explicit conversion.

i.e., YOUR_COMPUTED_COLUMN AS CONVERT(DECIMAL(18, 2), (qty * cost))

Explore More ContentExplore courses, solutions, and other research materials related to this topic.