Hello can any one help me to retrieve value from database saved in datetime format to HTML5 input type time control.
I tried to use
select REPLACE(REPLACE(CONVERT(varchar, CAST('1900-01-01 23:28:00' AS time) ,100),'AM',' AM'),'PM',' PM')
but it gives error
Type time is not a defined system type.
I want output as
11:28:00 PM

Sunny SharmaRank #223 · 11.1K reputationPosted Aug 8, 2013, 10:36 PM EDT
try this:
SELECT LTRIM(RIGHT(CONVERT(VARCHAR(20),CAST('1900-01-01 23:28:00' as DATETIME)), 7))
Hope it helps :)
piyusha patravali39 reputationPosted Aug 9, 2013, 2:03 AM EDT
Sunny SharmaRank #223 · 11.1K reputationPosted Aug 9, 2013, 2:40 AM EDT
Happy Coding :)
Cheers!!