Bug 152021 - A preset default "date" in a table will not be shown correctly in FORM when creating a new record
Summary: A preset default "date" in a table will not be shown correctly in FORM when c...
Status: RESOLVED DUPLICATE of bug 102945
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-13 09:32 UTC by HTK300
Modified: 2022-11-14 22:24 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
screenshot TABLE with default date in column left (98.51 KB, image/jpeg)
2022-11-13 09:34 UTC, HTK300
Details
screenshot TABLE with default date in column middle (99.30 KB, image/jpeg)
2022-11-13 09:35 UTC, HTK300
Details
screenshot TABLE with default date in column right (98.63 KB, image/jpeg)
2022-11-13 09:35 UTC, HTK300
Details

Note You need to log in before you can comment on or make changes to this bug.
Description HTK300 2022-11-13 09:32:53 UTC
Description:
the default date set in the table is not shown in the form. Moreover, when clicking through the three columns "Field name", "Field type", "Description"of the table, the preset default value for the date is somehow being altered, incremented, which is supposed to be fixed

Steps to Reproduce:
1. create a new database, with a TABLE that contains a Field of a date
2. try to set up the field type in a way to come up with a Default Date
3. save the table
4. create a FORM and have the record number and the Field "Date" shown on the form
4. save the FORM and the database
5. open the new database, go to FORMS, doupbleclick to add a new record
6. to do that, you have to click on the right arrow, that has a asterisk on it
7. look out for the Field "date" and see if the indicated default date as preset earlier in the TABLE will be shown.

Further findings:
A. when you created the table that contains the field of a date, setting it up to show a default date (say 11.11.2022) this value will somehow awkwardly be altered when simply clicking through the three columns of the field date...see attachements below 

Actual Results:
when you created the table that contains the field of a date, setting it up to show a default date (say 11.11.2022) this value will awkwardly be altered unintentionally, when simply clicking through the three columns of the field date...see attachements below 

Expected Results:
the preset default date is supposed to be fix and being shown up, whenever I am about to add a new record to the database. Also, when clicking through the line of the table which has the date that default date is supposed be maintained


Reproducible: Always


User Profile Reset: No

Additional Info:
see attachments
Comment 1 HTK300 2022-11-13 09:34:21 UTC
Created attachment 183556 [details]
screenshot TABLE with default date in column left
Comment 2 HTK300 2022-11-13 09:35:02 UTC
Created attachment 183557 [details]
screenshot TABLE with default date in column middle
Comment 3 HTK300 2022-11-13 09:35:31 UTC
Created attachment 183558 [details]
screenshot TABLE with default date in column right
Comment 4 Robert Großkopf 2022-11-14 07:03:03 UTC
You are mixing different problems here. I will only write about 'default value'.

GUI of Base offers a 'default' value for the tables. It will be saved in the Base file and will appear every time you create a new row in the table.
GUI of Base offers also a 'default' value for form controls. It could be different to the value of the table, because it is only saved in the description for the form control.
Seems you would use the same 'default' here. You have to change the default in the form for this value. 
Don't know a reason to use such a default value, created in for tables or form controls, for a date values. It will always be the same date …

Default, created by SQL for the database, won't be shown in a table or a form. It will be saved if the field will be empty (NULL). To get date with the current date while saving the data will work with

ALTER TABLE "Table" ALTER COLUMN "MyDate" SET DEFAULT CURRENT_DATE;
Comment 5 Stéphane Guillou (stragu) 2022-11-14 22:24:58 UTC
Regarding the default table value not being used in the date field in a form, this is not a bug, as Robert explained.

Regarding the issue with the increment of the date every time another column is selected, and the wrong default value when adding records to a table: it has been reported in other bugs.
Marking this bug as a duplicate.

*** This bug has been marked as a duplicate of bug 102945 ***