wh00t
Registered User.
- Local time
- Today, 14:44
- Joined
- May 18, 2001
- Messages
- 264
I currently use the following code to obtain the week number based on my companies financial year
but when it rolls over to the next year, the year start date has to be manually adjusted, is there any way that I can get access to automatically to revert back to week 1 after the 52 weeks are up instead of it going to 53+?
Code:
Public Function FinancialYear(dDate As Date) As Integer
FinancialYear = Year(dDate) - IIf(dDate < DateSerial(2003, 4, 27), 1, 0)
End Function
Public Function FinancialWeek(dDate As Date) As Integer
FinancialWeek = (dDate - DateSerial(2003, 4, 27)) \ 7
End Function
but when it rolls over to the next year, the year start date has to be manually adjusted, is there any way that I can get access to automatically to revert back to week 1 after the 52 weeks are up instead of it going to 53+?