DATE/TIME [TIMESTAMP] doesn't work in a subform

Creating and using forms
Post Reply
Buz
Posts: 42
Joined: Wed Sep 09, 2015 8:38 pm

DATE/TIME [TIMESTAMP] doesn't work in a subform

Post by Buz »

Good morning, all.

HSQLDB supports field type of DATE/TIME [TIMESTAMP], but there's a problem in my ooBASE subform.

I ran: alter table [TABLE1] alter column PAID_DATE set default CURRENT_TIMESTAMP
It executed successfully and works properly when I create a form based on that table, enter data and save. I see the expected data in my table: 01/16/17 05:23 AM

But when I create a new form with a related table in a grid attached to the MainForm and another grid in a subform that has the same columns, including my DATE/TIME [TIMESTA.MP] column, I get 01/16/17 12:00 AM.

So the timestamp is missing. I imagine there's a workaround. Can someone tell me how to get timestamp to work in a subform?

I just tested again and found that the problem is that timestamp is handled in ooBase as two fields: a DATE field and a TIME field, whether in a grid or not, and whether in a subform or not. This seems to conflict with my use of the DATE field DATE/TIME [TIMESTAMP] as a Primary Key. Can I use DATE/TIME [TIMESTAMP] as a PK?


Thanks,
Buz
OpenOffice 4.1.3, HSQLDB 2.3.4 embedded, Win 10; LibreOffice 5.2.4
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: DATE/TIME [TIMESTAMP] doesn't work in a subform

Post by Villeroy »

After using the SQL command window, you should always call table-menu:View>"Refresh Tables" and reload all opened forms in order to propagate the changes in database design.
Use a date control and a time control, both linked to the same stamp field. Or use a formatted field (similar to a spreadsheet cell) and apply some number format which includes date and time.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply