Posted by J.O. Aho on 10/10/86 11:39
mr gumpy wrote:
> I want to update a number of timestamps that look like this 1027094500
> to look like this 20051027094500
> This is the sort of thing I have been trying with no success:
>
> UPDATE `newCalls` WHERE timeStamp LIKE '10%' SET timeStamp LIKE '200310%'
>
> I would be grateful if anyone could tell me what I should be doing.
You need to use CONCAT and it's for strings, not for integers.
UPDATE newCalls SET timeStamp=CONCAT('2003',timeStamp) WHERE timeStamp LIKE '10%';
If your timestamp is in unix time, adding a year infront is to ruin the whole
thing with timestamps.
//Aho
[Back to original message]
|