Crystal Enterprise: 8.5
OS: Windows XP
I need to set the start of the Financial year to the day after the last Friday of November i.e. the start of the financial year this time is 27/Nov/2004
The below formula that sets the start of the year to the day after the last Friday of November worked fine last year but this year its started throwing this error: A month number must be between 1 and 12
Can someone please tell me whats wrong with it and how it can be fixed? It needs to return 27/Nov/2004
Cheers,
JSF
OS: Windows XP
I need to set the start of the Financial year to the day after the last Friday of November i.e. the start of the financial year this time is 27/Nov/2004
The below formula that sets the start of the year to the day after the last Friday of November worked fine last year but this year its started throwing this error: A month number must be between 1 and 12
Code:
if dayofweek(Dateadd("m", -month({?Run Date})-1, date(Year({?Run Date}),month({?Run Date})+1, 01)-1)) <> 6 then
Dateadd("m", -month({?Run Date})-1, date(Year({?Run Date}),month({?Run Date})+1, 01)-1)-dayofweek(Dateadd("m", -month({?Run Date})-1, date(Year({?Run Date}),month({?Run Date})+1, 01))) else
Dateadd("m", -month({?Run Date})-1, date(Year({?Run Date}),month({?Run Date})+1, 01)-1)-dayofweek(Dateadd("m", -month({?Run Date})-1, date(Year({?Run Date}),month({?Run Date})+1, 01)))+7
Can someone please tell me whats wrong with it and how it can be fixed? It needs to return 27/Nov/2004
Cheers,
JSF