jeudi 16 juillet 2015

How to convert GetDate() to "YYYY-MM-DD-HHMM" format?

I've been looking for the answer and could not find the exact one satisfying my needs.

I'm looking for the way to convert Datetime value into YYYY-MM-DD-HHMM format.

I tried that one:

select CONVERT(varchar(20),GETDATE(), 120) + replace(convert(varchar(5),getdate(),108),':','')

But it did not give me the right results

Is there any practical way to do it?

Aucun commentaire:

Enregistrer un commentaire