Finding the First Date of a Week

Finding the First Date of a Week

Question:
If I have the number of a given week of a year, how can I get the date of the first day of that week? For example, I want the date of Sunday of the 5th week in 1999.

Answer:
There’s not a built-in function that can do all the work for you on this one. However, you can do this:

  1. The first day of the year is always January 1st. (duh, right?) That will fall on some day of the week, which you can determine by using the Weekday function. Weekday will return you a number from 1 to 7 indicating what day of the week that date is.
  2. If you want to go to the beginning of the 5th week, you need to add (4 x 7) days to January 1st. The DateAdd function can do this and return you the date that the fifth week of the year starts on.
  3. Once you have that date, you can simply check the Weekday value of it to determine how many more days until you hit Sunday.
Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular