How Do I Zero-Fill an Int when converted to Char?

  • Hey that's cool!  As long as we're making it shorter, why not:

        DATENAME(yyyy, summary_date ) + '-' + RIGHT('0' + DATENAME( wk, summary_date ) ,2)

    DATEPART returns INT while DATENAME returns CHAR values, somehow I'd missed that detail before.

    AND I didn't finish reading the thread before I posted...Sorry Antares!

Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply