June 27, 201213 yr There's a calculation function for WeekOfYear, but not WeekOfMonth. I was trying to find a forum topic on it last week and didn't see one, then I came up with a solution that seems to work well. First, create a field that calculates the first of the month for the given date in your original date field. So if the original date filed is called 'Date' and the new field is called 'FirstOfMonth': FirstOfMonth = GetAsDate ( ( Month ( Date ) & "/" & "1/" & Year ( Date ) ) ) Then subtract the WeekOfYear for the FirstOfMonth field from the WeekOfYear for the Date field: WeekOfYear ( Date ) - WeekOfYear ( FirstOfMonth ) + 1 The plus one is because a date in the first week of the month would be 1 - 1 so it cancels out. I hope someone else can find this useful. This forum has been very helpful to me so when I came up with a solution I couldn't find on here I wanted to share it and give something back. I know it's pretty basic but it's still useful.
June 27, 201213 yr Or you could use this calculation by Ugo Posted Here (WeekOfYear(Date)+1)-WeekOfYear(Date(Month(Date);1;Year(Date)))
June 27, 201213 yr Author Even better- that does it all in one calculation instead of using two fields. Thanks :)
Create an account or sign in to comment