Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Decimal places
Message
From
24/02/2015 17:08:28
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
24/02/2015 13:21:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01615791
Message ID:
01615802
Views:
43
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform