mardi 24 mai 2016

How do i remove secounds from date time in SQL query

There are several ex for same type but i think this is bit unique.

My Query is:

select Convert(nvarchar(15),date,103)+ ' ' + LTRIM(RIGHT(CONVERT(CHAR(20),date, 22), 11))DC from Table1

Result is:

enter image description here

I am getting right in the above result. only thing i need to require is the format should 09/11/2015 2:29 PM.

there are Many format to achieve this but the user unlike to change any other format. Thank you in advance

Aucun commentaire:

Enregistrer un commentaire