I hate so much when it come down to convertion dates from one database system to another. I understand the concept of trunk and to_date used in oracle but
From:
nFirstDayOfWeek := TO_NUMBER(TO_CHAR(TRUNC(nDate, 'MONTH'), 'D'));
To SQL Server I tried:
SET @nFirstDayOfWeek = DATEPART(datediff(@nDate, 'MONTH'), 'd');
No Luck.
Error msg: Msg 174, Level 15, State 1, Procedure ISHOLIDAY, Line 18
The datediff function requires 3 argument(s).
Thank you.