
April 6th, 2011, 03:03 AM
|
|
Contributing User
|
|
Join Date: Sep 2006
Location: Plovdiv. Bulgaria
Posts: 200
  
Time spent in forums: 2 Days 6 h 50 m 14 sec
Reputation Power: 11
|
|
Quote: | Originally Posted by rmontz yes it is (var text) varchar(8) |
And what is the reason for not using type TIME for these fields? It's 4 byte(you'll save space) and you won't have these problems.
Try this and see does it help you
Code:
UPDATE TABLE1 SET
FIELD1 = LPAD(SUBSTRING(FIELD1 FROM 1 FOR POSITION(':', FIELD1) - 1), 2, '0') || ':' ||
LPAD(SUBSTRING(FIELD1 FROM POSITION(':',FIELD1) + 1 FOR POSITION(':', FIELD1, POSITION(':', FIELD1)) - 1), 2,'0') || ':' ||
LPAD(SUBSTRING(FIEDL1 FROM POSITION(':',FIELD1,POSITION(':', FIELD1) + 1) + 1),2,'0') FROM TABLE1
WHERE
CHAR_LENGTH(FIELD1) < 8
|