SELECT
IJDATE,
ROW_NUMBER() OVER( partition by year(IJDATE) ORDER BY IJDATE ) AS 'InvoiceDay'
FROM
S2K_IJ
WHERE
IJTYPE = '1'
AND
YEAR(IJDATE) > 2012
GROUP BY
IJDATE
ORDER BY
IJDATE
GO
You need to partition by the year so that it starts the count from 1.