Split Base DB. Field is Decimal. Decimal places was 2, now it's 0??? How to fix it!!!

Hi,
For several years I am using Split DB.
I am building a new DB, also Split. As I created the table, I set the field Interest_Rate to be Decimal with Decimal Places to 2. Now that I am inputting info/data…I just noticed the Decimal places set to 0?

  1. How did it get change?
  2. How to set “Decimal places” to 2 or 3?

Here is Libreoffice Base Version >>>
Version: 6.2.7.1 (x64)
Build ID: 23edc44b61b830b7d749943e020e96f5a7df63bf
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win;
Locale: en-US (en_US); UI-Language: en-US

Thanks in advance for you help!!!

Hello,

What database version are you using? What type field are you using? Where is the decimal places = 0 - Table view, form control (and type control)?

  1. DataBase Version: Version: 6.2.7.1 (x64) Build ID: 23edc44b61b830b7d749943e020e96f5a7df63bf CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; Locale: en-US (en_US); UI-Language: en-US

  2. Field Type >>>> Original Was: Decimal / Decimal Places = 2 . NOW Decimal Places=0.

Looks like I can use SQL command One field at a time. But if you have a better approach, please share it. Thanks!

ALTER TABLE “tst_tbl” ALTER COLUMN “fld” decimal(16,3)

Don’t forget to refresh the table

I got 27 Fields to deal with; some with info others are blank!

Hello,

Just tested with HSQLDB v2.3.2 and had no such problem. You did not give the DB version as a split DB can use whatever version is installed.

With a split DB (HSQLDB type widely used) you cannot modify already saved fields. So if incorrectly created & saved (most likely cause of your problem) then you have two choices:

  • Use SQL as you state

  • Use GUI by first deleting the problem field, save the table, then enter correct definition.

When creating tables, I typically go back through my fields to insure correct settings before saving. Have done this using various DB’s as there have been different occasions where say an auto increment did not take the first time.

Measure twice - cut once.

It may also help if you can duplicate the problem and list the steps taken. As stated cannot duplicate and tried both Decimal and Numeric fields.

I think this is where I went wrong!!!

  1. I added new fields on an existing table (Not a problem)

  2. My last few number fields on that table were set to 0 decimal (This is the problem)

  3. So, any fields that were added after the last one, if defaulted to 0 decimal after I saved the table. I think so, can’t confirm as its too late now…!

I am going to Just delete the newly added fields and rework the table to make my life easier. As new fields are just in test face; no important data in them as of now!!!

You must set the number of decimals for each new field entered. If you copy/paste a field, the number of decimals from the copied field will be retained in the pasted field.

Got it
Thanks for your help!