| View previous topic :: View next topic |
| Author |
Message |
Ates Guest
|
Posted: Sun Jan 30, 2005 12:05 pm Post subject: Paradox problem... |
|
|
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
|
Posted: Sun Jan 30, 2005 2:40 pm Post subject: Re: Paradox problem... |
|
|
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
|
Posted: Sun Jan 30, 2005 3:33 pm Post subject: Re: Paradox problem... |
|
|
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
|
Posted: Sun Jan 30, 2005 7:57 pm Post subject: Re: Paradox problem... |
|
|
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
|
Posted: Mon Jan 31, 2005 9:39 am Post subject: Re: Paradox problem... |
|
|
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 >= T
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 |
|
 |
|