Feb 24, 2003 #1 Timkins MIS Feb 24, 2003 2 0 0 GB Hi, Is there any way I can get the date of the first day of the week from the week number and year? Timkins
Hi, Is there any way I can get the date of the first day of the week from the week number and year? Timkins
Feb 24, 2003 #2 jms1 MIS Feb 24, 2003 4 0 0 GB You will find a good solution to this on the Crystal Decisions website. Upvote 0 Downvote
Feb 24, 2003 #3 GJParker Programmer Jul 4, 2002 1,614 0 0 GB This will give you the Monday for a Year and Week. 1. Create 2 number parameters for your year and Week numbers 2. Create the Following Formula //@MondayWeek Local NumberVar yr := {?YearParam}; Local NumberVar wk := {?WeekParam}; Local DateVar jan1 := CDate (yr, 1, 1); Local DateVar firstMondayOfYear := jan1 + (8 - DayOfWeek (jan1, crMonday)) mod 7; //weekNumberOfFirstMonday is either 1 or 2 Local NumberVar weekNumberOfFirstMonday := DatePart ("ww", firstMondayOfYear, crMonday, crFirstFourDays); DateAdd ("ww", wk - weekNumberOfFirstMonday, firstMondayOfYear) Gary Parker Systems Support Analyst Upvote 0 Downvote
This will give you the Monday for a Year and Week. 1. Create 2 number parameters for your year and Week numbers 2. Create the Following Formula //@MondayWeek Local NumberVar yr := {?YearParam}; Local NumberVar wk := {?WeekParam}; Local DateVar jan1 := CDate (yr, 1, 1); Local DateVar firstMondayOfYear := jan1 + (8 - DayOfWeek (jan1, crMonday)) mod 7; //weekNumberOfFirstMonday is either 1 or 2 Local NumberVar weekNumberOfFirstMonday := DatePart ("ww", firstMondayOfYear, crMonday, crFirstFourDays); DateAdd ("ww", wk - weekNumberOfFirstMonday, firstMondayOfYear) Gary Parker Systems Support Analyst