sql server - How do I remove seconds from date time in SQL query -


there several ex same type think bit unique.

my query is:

select convert(nvarchar(15),date,103)+ ' ' + ltrim(right(convert(char(20),date, 22), 11))dc table1 

result is:

enter image description here

i getting right in above result. thing need require format should 09/11/2015 2:29 pm.

there many format achieve user unlike change other format. thank in advance

try this:

   select convert(nvarchar, date, 101) + ' ' + left(right(convert(nvarchar, date, 100), 7),5) + ' ' +right(convert(nvarchar, date, 100), 2) 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -