SQL - Get Numerical Day of Month/Quarter
As for the day of quarter, this will demande a bit of further investigate on my side. Despite, I guess that for the day of month, this would simply be the date itself:
select DATEPART(D, @DATE)
DECLARE @DATE DATETIME
SET @DATE = GETDATE()
SELECT DATEPART(dy, @DATE) AS DayOfYear
, DATEDIFF(d, DATEADD(qq, DATEDIFF(qq, 0, @DATE), 0), @DATE) + 1 AS DayOfQuarter
, DAY(@Date) AS DayOfMonth
, DATEPART(dw, @DATE) AS DayOfWeek