Joe_Schmo Posted June 27, 2012 Posted June 27, 2012 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.
Lee Smith Posted June 27, 2012 Posted June 27, 2012 Or you could use this calculation by Ugo Posted Here (WeekOfYear(Date)+1)-WeekOfYear(Date(Month(Date);1;Year(Date)))
Joe_Schmo Posted June 27, 2012 Author Posted June 27, 2012 Even better- that does it all in one calculation instead of using two fields. Thanks :)
Recommended Posts
This topic is 4589 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