Home Forums SQL Server 7,2000 T-SQL How Do I Zero-Fill an Int when converted to Char? RE: How Do I Zero-Fill an Int when converted to Char?
Amit Jethva
SSCarpal Tunnel
Points: 4707
More actions
March 24, 2004 at 4:22 am
#500172
Let's make it even smaller
CAST(DATEPART(yyyy, datecol ) AS VarChar(4))
+ '-' + RIGHT('0' + DATENAME( wk, datecol) ,2)
-- Amit