To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=84918


User fs changed the following:

                What    |Old value                 |New value
================================================================================
                  Status|NEW                       |RESOLVED
--------------------------------------------------------------------------------
              Resolution|                          |INVALID
--------------------------------------------------------------------------------




------- Additional comments from [EMAIL PROTECTED] Thu Sep 18 12:26:15 +0000 
2008 -------
sorry, this is INVALID

Citing the help for the DateSerial function:
  The DateSerial function returns the number of days between December 30,1899
  and the given date.

Now what is written into the BoundField of the column is actually a mere number,
say 39709 (this would be the value for 18.09.2008). The implementation of the
bound field does not have any chance to recognize that the value has been
converted from a date *relative to 30.12.1899*. That is, it *can* recognize that
the value must be converted to a date value (simply because the underlying
database column requires a date value), but it does so using the standard SQL
"Null Date", and this isn't 1899-12-30, but 1900-01-01.

So, the numerical value passed to the bound field is interpreted relative to the
standard SQL Null Date, which differs by two days from the Null Date used by the
DateSerial function, which explains the difference you observed.

So, finally, this is a bug in the macro, as it uses an inappropriate data type
for passing values.

Possible solutions how to correct the macro include:
- Since the Null Date of DateSerial and the Null Date for database operations
  are well-defined, and known to differ by two days, just subtract those 2
  days from the return value of the DaySerial function.
- create a more appropriate data structure for passing the date. For
  instance, "Dim" a value as "new com.sun.star.util.Date", fill it, and
  write it into the BoundField.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to