Hi,
I looked at SQL Server dateformat codes but I couldn't find dd.mm.yyyy hh:mm format in the list. German Date Format(Code is 4) works for me but it doesn't contain hh:mm. Does someone know this format's code?
Hi,
I looked at SQL Server dateformat codes but I couldn't find dd.mm.yyyy hh:mm format in the list. German Date Format(Code is 4) works for me but it doesn't contain hh:mm. Does someone know this format's code?
Assuming your column is named [datefield]
CONVERT(varchar,[datefield],104)
+ ' '
+ SUBSTRING(CONVERT(varchar,[datefield],108),1,5)
select CONVERT(varchar,getdate(),101) + ' ' + SUBSTRING(CONVERT(varchar,getdate(),108),1,5) + ' ' + SUBSTRING(CONVERT(varchar,getdate(),109),25,2)
*you may change the getdate() to the datefield you are trying to convert.