I have datetime value as
2010-04-07 09:00:00.000
2010-04-07 14:30:00.000
how to convert the 14:30 to 2:30 pm
I have datetime value as
2010-04-07 09:00:00.000
2010-04-07 14:30:00.000
how to convert the 14:30 to 2:30 pm
Do you want to do it in a query if so look.
select date_format(date, "%Y-%m-%d %r") from table_name
also look at this
FOR MSSQL YOU SHOULD USE convert() method
SELECT RIGHT(CONVERT(varchar(7), Myvalue, 100), 7)
Even better would be to do this in the client code...
gbn, didn't you mean SELECT RIGHT(CONVERT(varchar(AT-LEAST-19), Myvalue, 100), 7)
?