On 12/29/2012 07:46 PM, Dan Lewis wrote:
On 12/29/2012 03:28 PM, Girvin R. Herr wrote:
Greetings,
I noted that after I updated LO from 3.5.7 to 3.6.4, the Base date
entry format flexibility has changed. With a 3.5.7 (and before) Base
form, I could enter 12-29-12 and it would be changed to 12/29/12.
With 3.6.4, entering 12-29-12 will result in a strange date, as if it
were interpreting the dashes as a formula and maybe subtracting the
numbers. Okay, I could live with that because it was apparent that
the date was incorrect. But now I see this is resulting in a Java
error when I accidentally use dashes and try to save the record. I
get "Java.lang.IllegalArgumentException" errors. Even that could be
worked around, if the error message had any diagnostics, such as the
offending date. However, this is all I get. No SQL. No indication
as to what the problem really is. I got a clue by doing a web search
and found a similar error with dates and put two-and-two together to
determine the real cause. I guess my complaint is that between 3.5
and 3.6, the error messages stopped putting diagnostic data into the
message. Has anyone else seen this "feature"?
Is there an option somewhere to add the diagnostics to error messages?
Note that I tried entering 12-29-12 into a Calc date cell where the
format was "MM/DD/YY" and it kept the dashes.
Girvin Herr
If you are going to use a date format with hyphens, perhaps
learning to use this format: YYYY-MM-DD. This is recognized by both
Base and Calc. (Probably by most databases and spreadsheets.
--Dan
Some additional testing in a database form: You can have a date
field in a form that accepts either dd-mm-yy or mm-dd-yy. You will have
to reformat the field to use the hyphens instead of the forward slash.
WARNING: If you do what I suggest below to change the date format
in the form, you should from that point on enter dates using hyphens
rather than forward slashes. However, this will not change the format in
the table that underlies the form. For example, I have a date field that
uses MM/DD/YY in its table and in the form the format is MM-DD-YY. In
the table I see 01/03/10 while in the form I see 01-03-10. The date in
long form is Sunday January 3, 2010.
Here is what I did:
1. I right click the form and selected Edit.
2. I highlighted the date field that I wanted to change. (Depending upon
the version of LO, you can do this with either clicking the field or
Control+click the field. You do not want to have the label highlighted
with the field.)
3. Right click the date field and select Replace with -> Formatted Field.
4. Right click the date field and select Control.
5. Click the Data tab.
6. In the "Data field", select the date field for the dropdown list of
fields.
7. Click the General tab.
8. In the Formatting property, click the ellipse (...) to open the
Number Format dialog.
9. Enter DD-MM-YY OR MM-DD-YY in the Format Code box.
10. Click the Green arrow to the right of the Format Code box.
11. Click OK.
12. Save the Form.
13. Save the database.
Now, it does not matter whether you enter a date in forms that
Base usually recognizes or DD-MM-YY or MM-DD-YY. What you see in the
field on the form is the format you created for the date field in the
form. Again, the date field in the table maintains the format that you
gave it when you created the table.
LibreOffice has reduced the number of formats that Base will
recognize on its own. This is true for dates in Calc as well. However,
as long as you define the format for what you will be entering, you can
still use formats you have used in the past.
--Dan
--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
- Re: [libreoffice-users] Base date entry less flexible · Dan Lewis
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.