SQL date formatting -
i have datetime column in table. how display time?
say, value in column 2013-03-25 08:40:00.000. how display value 08:40 alone?
thanks in advance.
try
select convert(varchar, getdate(), 8)
or
select substring(convert(varchar, getdate(), 8), 1, 5)
if want hh:mm
for more date formatting in sql server see this
Comments
Post a Comment