• Thanks for putting me in the right direction.

    If you want Monday to be day 1 and Sunday to be day 7 use this:

    SELECT ((DATEPART(dw, '2010-02-23') + @@DATEFIRST -2) % 7)+1 AS dw

    There's no day 0.