Quantcast
Channel: DataType question.
Viewing all articles
Browse latest Browse all 6

DataType question.

$
0
0
I am not certain of what to set the field type to for 2 seperate fields that are used in a calculation.  The problem is that with the current setup, the result of the calculation is rounding UPWARDS, so I believe it could just be:

1.  The precision and scale of the numeric field
2.  Not properly CAST in the T-SQL statement.

Tbl1
field1 (numeric(18,2)
0.90

Tbl2
field1 (numeric(18,2)
64.45

So, the result is

64.45 * 0.90 = 58.01

I am expecting a result of: 58.00

edit: Expecting the result of 58.00 in a 3rd field set up as numeric(18,2)

What would be the proper datatype, precision and scale for the field1 fields to produce the desired output of 58.00?

Thanks

jfc

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>