OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Time field not accepting 1/100th of seconds

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
rktu
General User
General User


Joined: 23 Nov 2006
Posts: 7

PostPosted: Thu Nov 23, 2006 7:04 am    Post subject: Time field not accepting 1/100th of seconds Reply with quote

Hi,

I've been trying to create a DB to track the times of the swimmers in our local swimming club.

I create the tables and relatinships were needed but when I go to enter the times in the tables it will not accept the hundredths of second. The format being used is mm:ss.00 which is what is advised by the help.

When I enter the .xx it reverts to zero. (eg 1:06.34 becomes 1:06.00) I have tried replacing the .00 in the format with ## but this is not accepted.

I am using version 2.02.

Has anyone got any sugestions for me.

Regards,

Rob
Back to top
View user's profile Send private message
DiGro
Super User
Super User


Joined: 02 Jun 2004
Posts: 1415
Location: Hoorn NH, The Netherlands

PostPosted: Thu Nov 23, 2006 8:40 am    Post subject: Reply with quote

Rob,

tried it on 2.0.4. It simply accepts the entry: 01:06.45
This should be the default format when entering a time WITH a decimal separator.

That is: 1 : 06 . 45 (minutes colon seconds decimal separator 100" sec )

Don't really know what separator your locale is using but it might be the comma instead of the dot ?
_________________
DiGro

Windows 7 Home Premium and AOO 4.0.1 NL (Dutch)
Back to top
View user's profile Send private message
rktu
General User
General User


Joined: 23 Nov 2006
Posts: 7

PostPosted: Sat Nov 25, 2006 12:14 am    Post subject: Reply with quote

Thanks for the reply.

Was using ":" and "." seperators. Thats the way we reocord time in Australia.

Might see if 2.04 solves the problem.

Thanks again.

Rob
Back to top
View user's profile Send private message
rktu
General User
General User


Joined: 23 Nov 2006
Posts: 7

PostPosted: Sat Nov 25, 2006 4:42 am    Post subject: Reply with quote

Have tried it with version 2.04 and the same result:

Data entered 00:36.17

Data recored 00:36.00

The fraction of second stays until you tab to the next record then it zeros itself.

Please help.

What am I doing wrong.
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6732
Location: Kingston ON Canada

PostPosted: Sat Nov 25, 2006 8:19 am    Post subject: Reply with quote

rktu wrote:
Have tried it with version 2.04 and the same result:

Data entered 00:36.17

Data recored 00:36.00

The fraction of second stays until you tab to the next record then it zeros itself.

Please help.

What am I doing wrong.


You are using 2 formats. Smile You need 00:36:17 Note the : between each part of the time.

With Canadian settings I get the weird result that 00.36.17 appears but it is a number not a time.
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Sat Nov 25, 2006 9:44 am    Post subject: Reply with quote

What kind of data store are you using? What is the data type for the field?

If the database is using a datatype that stores times as integer seconds, then no matter what format you use, it's going to throw away the fractional part.
Back to top
View user's profile Send private message
rktu
General User
General User


Joined: 23 Nov 2006
Posts: 7

PostPosted: Sat Nov 25, 2006 9:51 am    Post subject: Reply with quote

The format I have show is standard under time, take a look.
Back to top
View user's profile Send private message
rktu
General User
General User


Joined: 23 Nov 2006
Posts: 7

PostPosted: Sat Nov 25, 2006 10:05 am    Post subject: Reply with quote

Is there anywhere I can post a copy of the basic db file?
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Sat Nov 25, 2006 10:55 am    Post subject: Reply with quote

I can only assume you are using the default options, meaning the data are stored in an HSQLDB database. Unfortunately, the HSQLDB docs only specify the data types in terms of the Java data types, and the Java docs indicate it could be either integer seconds, or integer milliseconds. I guess we would have to make a deep dive into the HSQLDB source code to find out for sure.

In my playing around with it, it looks like it is storing seconds, so no matter what you enter, it gets truncated to an integer number of seconds.

As for your database, just store the time as an integer, and scale it yourself. You can define it as the number of milliseconds, or 1/10 seconds or whatever you like. Or define it as a decimal field and call it seconds. Then you can deal with the fractional part easily.
Back to top
View user's profile Send private message
rktu
General User
General User


Joined: 23 Nov 2006
Posts: 7

PostPosted: Sat Nov 25, 2006 5:15 pm    Post subject: Reply with quote

Thank for the info acknak,

Gave me the idea to do the following.

minutes field (integer)
Seconds field (integer)
Fraction field (integer)

Then format using the form output.

I dont have to do any calc on the the times just comparisons.

Somtimes you just have to think outside the "box".

I'll let you all know if it works for me.

Regards,
Rob
Back to top
View user's profile Send private message
rktu
General User
General User


Joined: 23 Nov 2006
Posts: 7

PostPosted: Mon Nov 27, 2006 6:23 am    Post subject: Reply with quote

Hi again,

Was setting up the seperate fields and decidedd to start fooling around with field types.

What I finally tried was setting the field type to "REAL" and then using the mm:ss.00 field format. Guess what it worked and the info recorded is in minutes seconds and hundredths. (ie 00:66.25 will become 01:06.25 when you move to the next record.

The "Date" field type must be based on integers and therfore won't accept fractions.

It's amazing what happens when you fool aroun. Smile

Regards,

Rob.
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Mon Nov 27, 2006 8:17 am    Post subject: Reply with quote

Just be aware that when you do this, again the database is not storing what you may think it's storing. When you input a time like "00:66.25" someone (I'm not sure if it's OOo Base or the database itself) converts this to a fractional number of days: 66.25s / (seconds per day=86400) = 0.000766782407407407... (which appears to have no exact representation in ieee floating point). You can see this if you enter some times, then change the column format to a decimal format.

I honestly can't think of anything you might do with swim meet records that this would cause problems for, but if I were you, I would stick with storing my data in a form as close as possible to the form I actually measure it in, in this case fractional seconds, and worry less about the formatting.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group