Tech Spot
.Net, C#, SQL, BI and much more......
Thursday, October 21, 2010
Convert Date to String in SQL Server
DECLARE @Dt as DateTime
SET @Dt = '2010-04-27 11:30:17'
SELECT CONVERT(CHAR(8), @Dt, 112) +
REPLACE(CONVERT(CHAR(8), @Dt, 114), ':', '')
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment