I'm trying to create custom week numbers and ranges based on user entered Week Start Day.
I'm passing that User defined day with SET Datefirst = @Userdefinedvalue
(using a function to map my weekday start values to T-SQL's). Also I have a function to gets me the last day of the current week.
What is the best approach for this?
My Goal is: if I select Tuesday as my start day of the week the Stored Procedure to generate my week numbers and start/end dates based on my selection for the entire year