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?

  • Let's make it even smaller

    CAST(DATEPART(yyyy, datecol ) AS VarChar(4))

        + '-' + RIGHT('0' + DATENAME( wk, datecol) ,2)

     


    -- Amit



    "There is no 'patch' for stupidity."



    Download the Updated SQL Server 2005 Books Online.