Calculate Week Of Date from Week Number

Good morning,
I have a simple request to turn the week number into a date. In this instance, week number is the for this year. So I used the following formula. The day and month get calculated correctly, but my year says 1900. I am working in the BAQ calculated field editor.
Why doesn’t this work, and what is the fix?

dateadd(week, SubQuery1.Calculated_WeekNumber, 1/1/ datepart(year, Constants.Today))

Trial and Error prevails!
This seems to work:

dateadd(week, SubQuery1.Calculated_WeekNumber, '1/1/' + convert(varchar,datepart(year, Constants.Today) ))

Although this works, I can see that it might not always give the exact right date. In this case I don’t think it is a problem. But it would be nice to be able to go from week number back to a real date. If you all have any ideas let me know!

Slightly modified for this year and a week starting on Monday.

dateadd(day, -5, dateadd(week, (SubQuery1.Calculated_WeekNumber-1), '1/1/' + convert(varchar,datepart(year, Constants.Today) )))
1 Like