I’m trying to determine the day of a given a week date given (i.e. YYYY-W##) in the ISO 8601 format. My end goal is to convert an ISO 8601 Week Date to an ISO 8601 Calendar Date. I need to do this in TSQL (I’m working with SQL Server 2005), I’m not sure if there’s anything already built-in to SQL Server 05 that allows this, but it would help to see an example in another language or in generic pseudocode
UPDATE:
Sorry if the structure of my question is confusing. Basically, I have a ISO8601 week date that I’m trying to convert to ISO8601 Calendar Date.
Examples (from Wikipedia)
ISO 8601 Week Date: 2012-W02 (YYYY-W##)
Convert to…
ISO 8601 Calendar Date: 2012-01-09 (YYYY-MM-DD)
Since the day component isn’t given in my week date example, the first day of the week can be assumed.
Try the following solution:
Output: