Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2012-05-04 : 12:59:01
How to get the date output in the following format
2012-04-21 15:38

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2012-05-04 : 13:18:26
I was able to get the output with below query

select CONVERT(CHAR(16), getdate(), 120)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-04 : 18:48:25
why convert date to varchar? if you dont want to consider seconds part just make field of smalldatetime type

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -