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

Drag and drop adds two days to date

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


Joined: 19 Nov 2005
Posts: 22

PostPosted: Wed Aug 02, 2006 7:46 pm    Post subject: Drag and drop adds two days to date Reply with quote

I'm converting a personal financial application I had in Calc into Base.

I moved the records for the chequing account table by selecting The table in Calc and dragging it onto Base, which creates "Table1" to hold it. Then I use some SQL to move it into another table which is its new, permanent home.

One of the columns in calc was the transaction date. The column is in a date format. When I drag the data to Base, it adds two days to each of the dates. What's worse, is that HSQL doesn't support any date arithmetic, so it's not like I can just run some SQL to fix it. I can probably figure out how to write a macro in Calc to alter the date before I drag it over, but is there some reason Base is adding these two days?
Back to top
View user's profile Send private message
trenkler
Power User
Power User


Joined: 21 May 2005
Posts: 55

PostPosted: Wed Aug 02, 2006 10:44 pm    Post subject: Re: Drag and drop adds two days to date Reply with quote

ajardine wrote:

One of the columns in calc was the transaction date. The column is in a date format. When I drag the data to Base, it adds two days to each of the dates. What's worse, is that HSQL doesn't support any date arithmetic, so it's not like I can just run some SQL to fix it. I can probably figure out how to write a macro in Calc to alter the date before I drag it over, but is there some reason Base is adding these two days?


It is bug. I have the same problem.
Back to top
View user's profile Send private message
DrewJensen
Super User
Super User


Joined: 06 Jul 2005
Posts: 2616
Location: Cumberland, MD

PostPosted: Wed Aug 02, 2006 11:19 pm    Post subject: Reply with quote

Well, there is good news.

The bug seems to finally be dead in the latest developers build, #178. I bleieve it was still there in 2.0.3. It seems OOo is on a pretty steady 3 month release cycle now, so 2.0.4 shouldn't be too long out if you want to wait for a stable release.

Otherwise I believe this workaround will help you now.

Create a Base database file that uses the spreadsheet as the external database. Then copy the table (drag and drop) from this ODB file to the native SQL ODB file. That should take care of your date shift.

Drew
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ajardine
General User
General User


Joined: 19 Nov 2005
Posts: 22

PostPosted: Mon Aug 07, 2006 11:52 am    Post subject: Reply with quote

Thanks Drew! This worked perfectly.
Back to top
View user's profile Send private message
amberleadavis
Newbie
Newbie


Joined: 02 Sep 2009
Posts: 3

PostPosted: Wed Sep 02, 2009 4:31 pm    Post subject: 2 Days are still added with Drag and Drop Reply with quote

And I'm using oobase 3.1.0.

I already have a whole lot of data into the tables before I realized that the dates are each two days off. I've seen the problem before in excel. I think the problem may be with the date formats - but I don't know.

Anyone have any ideas? Idea

Thanks!
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Thu Sep 03, 2009 10:15 am    Post subject: Reply with quote

I wonder how this can happen in OOo3. What is the type of database and what about the spreadsheet?
Tools>Options...Calc>Calculation
Set day zero to 1900-01-01
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
Back to top
View user's profile Send private message
amberleadavis
Newbie
Newbie


Joined: 02 Sep 2009
Posts: 3

PostPosted: Thu Sep 10, 2009 11:52 pm    Post subject: Database is standard - the one that you would create w/ GUI Reply with quote

THe spreadsheet is an openoffice CALC. I use the feature of dragging the data straight across.

I tried this in access and had similar issues, but I wasn't paying attention at the time.

I can give you some sample data.

I very much suspect that the problem may be with the original excel files. I opened them in excel, then updated them in oo.o The files were saved the the oo.o format. The excel field stores the dates in one method, that even going to access caused trouble - the same tow days.

What are your thoughts?
Back to top
View user's profile Send private message
amberleadavis
Newbie
Newbie


Joined: 02 Sep 2009
Posts: 3

PostPosted: Thu Sep 17, 2009 4:57 pm    Post subject: Problem Solved Reply with quote

You may not need to do all these steps, but this is what I did and it worked.

I changed the format of the cells in calc to be:

mm/dd/yyyy

but the change that made the most difference was creating the table in oobase - with all the definitions - including telling oobase that the date was formatted as mm/dd/yyyy.

Then I appended the data.

No problems.
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