BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Paradox problem...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Ates
Guest





PostPosted: Sun Jan 30, 2005 12:05 pm    Post subject: Paradox problem... Reply with quote



Hi;

I have 2 different fields DDate(DATE) and DTime(TIMESTAMP) field.

I am trying to do "Update Transactions set DTime = DDate + CAST(DTime as
TIMESTAMP) where DTime >= '01.01.3000'";

This gives me error. I am using Paradox db. Can someone please help?

Why am I doing this?

I have used 2 different fileds. DTime was (TIME) now I have changed it to
TIMESTAMP and I need to convert it. If I do this in a loop it takes too much
time to apply over 40.000+ records. I know there was a way but i couldn't
find...

Regards;



Back to top
Bill Todd
Guest





PostPosted: Sun Jan 30, 2005 2:40 pm    Post subject: Re: Paradox problem... Reply with quote



Try something like the following (not tested):

SET DTIME = CAST(CAST(DDATE AS VARCHAR(10) || ' ' || CAST(DTIME AS
VARCHAR(12), AS DATETIME)

--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
Back to top
Ates
Guest





PostPosted: Sun Jan 30, 2005 3:33 pm    Post subject: Re: Paradox problem... Reply with quote



This didn't work. but i didn't understand this one. I think that didn't work
because of typos. Could you explain the idea please? Or a tested version
should be better if you mind...

"Bill Todd" <no (AT) no (DOT) com> wrote

Quote:
Try something like the following (not tested):

SET DTIME = CAST(CAST(DDATE AS VARCHAR(10) || ' ' || CAST(DTIME AS
VARCHAR(12), AS DATETIME)

--
Bill Todd (TeamB)
TeamB cannot answer questions received via email



Back to top
Bill Todd
Guest





PostPosted: Sun Jan 30, 2005 7:57 pm    Post subject: Re: Paradox problem... Reply with quote

It is not a typo but rather me not thinking clearly that prevents my
suggestion from working. The idea was to cast the data as a string and
cast the time as a string, concatenate the two and cast that as a
TimeStamp. The problem is that the time is in a TimeStamp field so casting
it to a string will produce a string that already includes the date.

I cannot think of any way to do what you are trying to do in Local SQL.

--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
Back to top
Ates
Guest





PostPosted: Mon Jan 31, 2005 9:39 am    Post subject: Re: Paradox problem... Reply with quote

Hi thanks so much for the answer. I have changed this a bit and it worked
fine.

Update Transactions set DTime = CAST(TRIM(CAST(DDate AS VARCHAR(20))) + " "
+ TRIM(SUBSTRING(TRIM(CAST(DTime AS VARCHAR(22))) FROM 10)) AS TIMESTAMP)
WHERE DTime >= Very HappyT

Now the problem is Date format is always different for different systems. If
i change my date format this will not work fine. I couldn't really find a
way to fix this.


"Bill Todd" <no (AT) no (DOT) com> wrote

Quote:
It is not a typo but rather me not thinking clearly that prevents my
suggestion from working. The idea was to cast the data as a string and
cast the time as a string, concatenate the two and cast that as a
TimeStamp. The problem is that the time is in a TimeStamp field so casting
it to a string will produce a string that already includes the date.

I cannot think of any way to do what you are trying to do in Local SQL.

--
Bill Todd (TeamB)
TeamB cannot answer questions received via email



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
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, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.