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

Creating and using forms

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

Postby Buz » Mon Jan 16, 2017 12:46 pm

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
Buz
 
Posts: 42
Joined: Wed Sep 09, 2015 8:38 pm

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

Postby Villeroy » Mon Jan 16, 2017 2:21 pm

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 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24656
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Forms

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests