SQL Date Extrapolation
Posted on 2005-03-15
Does anyone have a function that I could for instance pass the following:
- Number between 1 and 5
- DayofWeek (1=Sunday,2=Monday, etc...)
So I if I were to pass in 3,2005,1,1 the function would return the date of the first sunday in March of 2005
If I passed 3,2005,2,2 I would get a date which represented the 2nd Monday in March of 2005.
If the info entered would retrun an error the function should return 'ERROR' or something like that.
I really need this function.