I have a time value being stored in a database as a varchar(4) and I need to convert it to real time.
for example, if the time is \"23:59\" I want 11:59PM returned.
This is a quick hack, but since you're missing the ":" between the 4 digits number how about inserting the missing colon.
SELECT TIME_FORMAT( CONCAT( SUBSTRING('2359', 0, 2), ':', SUBSTRING('2359', 3, 2)), '%h:%i');
Of course, replace the 2359 with the time column name.