Danny:
What if you just pad the string, does it work then?
str_to_date( LPAD( '901', 4, '0' ), '%k%i' )
Wes
On Jul 22, 2004, at 2:05 PM, [EMAIL PROTECTED] wrote:
I have a "time" field formatted as hhmm however the hours field does
not
add leading zeros. eg 09:01 is simple 901.
I want to get a standard format time out but,
mysql> str_to_date('901','%k%i')
gives a NULL result.
A further test reveals that I can covert into the desired format but
not
back.
mysql> select TIME_FORMAT('8:53:00', '%k%i') \G
*************************** 1. row ***************************
TIME_FORMAT('8:53:00', '%k%i'): 853
1 row in set (0.00 sec)
mysql> SELECT str_to_date(TIME_FORMAT('8:53:00', '%k%i'), '%k%i') \G
*************************** 1. row ***************************
str_to_date(TIME_FORMAT('8:53:00', '%k%i'), '%k%i'): NULL
1 row in set (0.00 sec)
Is there any way out?
Danny
mysql 4.1.3-beta-standard
Magdalena Ridge Observatory
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]