Apache OpenOffice (AOO) Bugzilla – Issue 108229
Date/Time functions do not work with parameters
Last modified: 2017-05-23 00:29:48 UTC
SELECT * FROM "X" WHERE DAYOFWEEK( :paramDay )= "X"."WeekDay" => wrong type Same problem with other date/time functions and :parameter substitution (I tested MONTH, HOUR)
I can confirm on OOo3.2RC1 linux version(only tested on it)
Created attachment 67513 [details] document to reproduce the bug case
confirming: - open the attached database document - open the contained query by double-clicking it => the parameter input dialog opens - enter a date value in the "Value" field - press OK => you get an error message saying that this is no legitimate value for the column (which is wrong) - enter a plain numeric value in the "Value" field - press OK => the value is accepted (which is wrong) => the query's data view opens, but you get an error message saying something about an illegal type fs->oj: I'd say the problem here is that the parser recognizes the parameter as integer column, since the return type of DAYOFWEEK is an integer. It should, however, recognize it as date column.
Fixed in cws dba34c
Please review. Thanks.
not fixed, the result of the date parameter is wrong. In the table in the bugdoc insert 2 as value for the dayofweek field. An in the query parameter insert 2011-02-21. The record is not found.
reassign to oj
.
Please verify. Thanks.
verified in cws dba34d
Checked in DEV300m104, OK.
Comment on attachment 67513 [details] document to reproduce the bug case This appears the same problem in different terms from my experience - date/time functions can't work with date/time strings that have auto-appended apostrophes - and this happens when date/time strings are copy-pasted into Calc. Trying to bulk edit them out is not possible due to an additional bug that causes mangling of the string when trying to do a simple global replace of "'" for "". Hand editing of strings in Calc does fix the problem, which appears to be an auto-correct adding of an "'" to the date/time string upon pasting. Can this be fixed by a simple setting change? Any help appreciated.