|
Posted by eddiekwang on 10/25/06 17:41
I have a table called class_time. and the column name is start_time.
datatype is datetime.
id start_time
2 1900-01-01 15:00:00.000
4 1900-01-01 17:12:00.000
i want to the convert the start_time column into a format that only
has the hour and minutes plus AM/PM ( for example, 3:00 pm, 5:12pm)
id start_time new format
2 1900-01-01 15:00:00.000 3:00 pm
is there any simple one step way to do that?
(the only way i know is to use the following query, then do a substring
where the space is. but that's too complicated)
select CONVERT(CHAR(20), start_time, 22) from class_time
Thank you in advance for your time.
Navigation:
[Reply to this message]
|