Saturday, December 28, 2013

How to Concatenate Date in T-SQL using custom format?


declare @testdate datetime
set @testdate = '2011-01-25 07:32:21.000'

SELECT LEFT(CONVERT(varchar(10) ,@testdate, 120),8) + '01'

-----------------





Chuck Pedretti | Magenic – North Region | magenic.com


No comments:

Post a Comment