>Hi All:
>
>What determines the length of a calculated numeric field in SQL? In the following example I was expecting no decimal places, since the calculated field in the first record was 0. However, lo and behold, the structure is N(10, 4). Where did the SQL get that?
>
>I used this test because in the real environment I was getting either '0' or '*' in all the records and I was trying to figure out a way to 'force' a N(10, 5).
Well the longest from that is -999/1, four integer digits. The minimum of it is 1/999, so it concluded that beyond about four digits the result would have the same number of significant digits as the operands. Thus four integer digits, four decimals, sign - n(10,4) (doesn't store the point, IIRC, but usually adds one digit for that guy Justin Case. It simply has to fit the longest possible results.