• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

How to set Format and decimal places using ALTER TABLE

Can anyone help with the ALTER TABLE statement to change a fieldsize Long Integer to Fixed Format 2 decimal places.

Thanks in advance.
0
CRB1609
Asked:
CRB1609
1 Solution
 
PatHartmanCommented:
That is not possible.  Integers are whole numbers.  If you want decimal positions, you need to use a data type that supports them.  The most user-friendly choice is Currency which works as long as you only need four decimal places.  Don't confuse the Currency data type with the Currency format.  The Currency data type can be formatted however you want.

Also, formatting doesn't affect how data is stored.  It only affects how data is displayed.  Formatting is for humans.
0
 
CRB1609Author Commented:
Thanks very much.  I never did understand the difference.  Now I do.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now