https://bugs.documentfoundation.org/show_bug.cgi?id=96190

            Bug ID: 96190
           Summary: Date in Form shows different values in Datefield and
                    Formatted Field, if based on an integer Column
           Product: LibreOffice
           Version: unspecified
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 120937
  --> https://bugs.documentfoundation.org/attachment.cgi?id=120937&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to