Skip to content
Advertisement

Week number and its Sunday

I have a simple question.

If I have a week number, how I assigned a Sunday to it? (In t-sql)

For example. I have number 15 as input (which is week from 8.4. to 14.4., from monday to sunday), and I will need it to be shown as 14.4. as output. The things is, that I have a column of days converted to number of week (col1), and I need a Sunday of this week number (col2).

Advertisement

Answer

Use this, remember, you need know also the year, not only weekNo

Week in this case start on Monday and end on Sunday, you will get the sunday in requested week

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement