I have a requirement to calculate the next monthly run time of a job which can be specified using two parameters which can take values from
Parameter 1:
1 for Sunday, 2 for Monday, 3 for Tuesday, 4 for Wednesday, 5 for Thursday, 6 for Friday, 7 for Saturday, 8 for Day, 9 for Weekday, 10 for Weekend day
Parameter 2:
1 for First, 2 for Second, 4 for Third, 8 for Fourth, 16 for Last
Based on these two parameters you can specify a run time like First weekday of the month or Last sunday of the month.
How do I arrive at this date using a stored procedure which will know current date, para1 and para2