john9210 Posted March 28, 2011 Posted March 28, 2011 I would like to create a script that,given a value of WeekOfYear, creates seven new records, and populates the date fields with dates that correspond to the WeekOfYear. For example, for WeekOfYear 14, 2011, the new records would have the dates 3/27/11, 3/28/11, 3/29/11, 3/30/11, 3/31/11, 4/1/11 and 4/2/11.
comment Posted March 28, 2011 Posted March 28, 2011 Hint: The Sunday on or before Jan. 1 is the starting day of week 1. The starting day of week x is 7*(x - 1) days later.
john9210 Posted March 30, 2011 Author Posted March 30, 2011 Hint: The Sunday on or before Jan. 1 is the starting day of week 1. The starting day of week x is 7*(x - 1) days later. Thanks for the tip. I'm not sure why the formula works, but it works beautifully! And simple too! John
Recommended Posts
This topic is 4987 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now