I've seen many questions related to the format and date/time
conversion in SQL Server but none answer my concern (it is not duplicated). For example.
When executing this statement:
select
convert(varchar(20), cast('2018/03/05 18:00:00.000' as time), 100) as entryTime
I get this result:
I want the output to be 06:00:00 p.m.
Is there any way to get a result like this: 06:00:00 p.m.
?
Environment: SQL Server 2008 R2
Unfortunately, the FORMAT
and FORMATDATETIME
functions are not yet available in this SQL Server version.