Get Week From Date in RDA?

MrShen122

Member
I am kinda new to RDA, is there a Business Function that I can use to input a date and get the Weekly period(1-52) out?

Thanks
 
Use N0501033
Use your start date then use the date you want to compare

Round up the mnWeeksBetween_MATH01 field

As Al says, use F9862 to put in words you want to search on and then either call them in a test screen or use Object Browser from patwel.com
 
I encountered this problem several years ago. Believe it or not, getting the week number for a given date is not as straight forward as you might think. After some research I ended up rolling my own functioin. These are the notes from the header file in the attached BSFN to give you some idea.

Code:
/********** Week In Year Methods **********
AcmeGetWeekInYear.nCalcMethod

E5800023_WEEK_IN_YR_ISO_8601
	Week start=Monday, week end=Sunday
	Week = 1-53
	Assigns week to year and calcs week num based on which year has the most days
	
E5800023_WEEK_IN_YR_ANSI_C_MON_FIRST
	Week start=Monday, week end=Sunday
	Week = 0-53
	The first Monday of January is the first day of week 1; days in the new year before this are in week 0

E5800023_WEEK_IN_YR_ANSI_C_SUN_FIRST
	Week start=Sunday, week end=Saturday
	Week = 0-53
	The first Sunday of January is the first day of week 1; days in the new year before this are in week 0
*/
 

Attachments

  • b5800023.zip
    4.8 KB · Views: 58
Are you talking about the calendar week of the year -OR- are you talking about the fiscal week (based on fiscal period setup)?
If just the calendar week, do something like Brian presented.
If fiscal week, you want to look at F0008B.
 
Back
Top