Bug 96190 - Date in Form shows different values in Datefield and Formatted Field, if based on an integer Column
Summary: Date in Form shows different values in Datefield and Formatted Field, if base...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Forms
  Show dependency treegraph
 
Reported: 2015-12-01 19:33 UTC by Robert Großkopf
Modified: 2018-11-05 19:44 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Open Form and have a look at the different dates shown from the same datasource. (11.91 KB, application/vnd.oasis.opendocument.database)
2015-12-01 19:33 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2015-12-01 19:33:58 UTC
Created attachment 120937 [details]
Open Form and have a look at the different dates shown from the same datasource.

Open the attached database.
Open the form.

There are 5 fields: 
"ID" for the primary key.
"Date", which is a date field in the table, shown in a date field of the form and also shown in a formatted field.
"Date_as_Integer", which is an integer field in the table, shown in a date field of the form and also shown in a formatted field.

Now have a look to the value of "Date_as_Integer" in the formatted field. differs 2 day to the same value shown by the date field.

Open the table. I have formatted the "Date_as_Integer" in the table-view as a date. The table shows the same behaviour as the formatted field of the form.

Seems the date field of the form starts counting with date 1900-01-01 as '0', the formatted field starts counting with date 1899-12-30 as '0'.

All this appears only if the base-value of the field is an integer value. This would be used in the internal HSQLDB, because there isn't a function like dateadd integrated. I'm using queries like this:
SELECT "Date", DATEDIFF('dd','1899-12-30',"Date")+21 AS "Returdate" FROM "Table"

This gives the correct value in formatted field and in a formatted query, but doesn't show the correct value in a date-field.
Comment 1 Robert Großkopf 2015-12-01 19:43:54 UTC
I have forgotten to write down the testsystem:
Tested with OpenSUSE 13.2 64bit rpm Linux.
Tested with LO 5.1.0.0.beta1, 5.0.3.2, 3.6.7 (no older installed hier.
Tested also with AOO 4.1.2
All tested Office-Versions give the same result. Could be it is inherited by OOo, but I can't test it here, because I haven't installed the early versions any more.
Comment 2 Buovjaga 2015-12-04 19:20:36 UTC
Confirmed.

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: 81fa5340191baf8687f9c82f1f414f5afc86b529
Threads 4; Ver: Windows 6.1; Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-03_21:19:19
Locale: fi-FI (fi_FI)
Comment 3 Robert Großkopf 2016-03-05 07:34:50 UTC
Have tested with the first available LO-version (LO 3.3.0.4, OpenSUSE 42.1 64bit rpm Linux). Couldn't open the form. LO crashes immediately.
Comment 4 Robert Großkopf 2016-03-06 18:22:33 UTC
Could be this one is inherited from OOo, but I can't start a form with a integer-field, which is connected to a formatted field in LO 3.3.0. LO crashes and would only start the form when deleting this field.
Comment 5 QA Administrators 2017-10-23 14:11:44 UTC Comment hidden (obsolete)
Comment 6 Robert Großkopf 2017-10-26 07:08:45 UTC
tested again with
Version: 6.0.0.0.alpha0+
Build ID: cfbb8b5090537e79ba70e250ddee86d53facbe15
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: kde4; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-10-18_22:54:20
Locale: de-DE (de_DE.UTF-8); Calc: group

on OpenSUSE 42.2. Same buggy behavior. Different dates in date-field and formatted-field if datasource is integer.

Same behavior in LO 5.4.3.1 on same system.

Have set this one to Inherited from OOo - couldn't test, but same behavior in LO 3.6 and AOO.
Comment 7 QA Administrators 2018-11-03 03:50:12 UTC Comment hidden (obsolete)
Comment 8 Robert Großkopf 2018-11-05 19:44:11 UTC
Bug still exists with LO 6.1.3.2, 64bit rpm Linux.