Find the starting day for a given month and year

vijchag

Member
Hello folks,

Is there any way that I can find the starting day for a given month and year either using ER or BSFN?

Example: I pass the month and year as 04 and 2016. It should tell me that its either "Friday" or the day number in the week which is '6'.

Thank you.
 
Take a look at P00071 Workday Calendar application. This may give you some ideas on how to use B3000700 to get what you need.
 
Hello vijchag

Try this. I recently wrote 2 lines fo code to find out the day of the week. In your case, you need to create a variable to pass the date like 04/01/2016 instead of SL DateToday.

Below is the actual code from my UBE.
if VA rpt_mnDayOfWeek_MATH01 == 0 means Sunday
if VA rpt_mnDayOfWeek_MATH01 == 1 means Tuesday
if VA rpt_mnDayOfWeek_MATH01 == 5 means Friday

VA rpt_jdBaseSundayDate_UPMJ = "1/4/2015"
VA rpt_mnDayOfWeek_MATH01 = mod(days_between([VA rpt_jdBaseSundayDate_UPMJ],[SL DateToday]),7)

Hope this helps
8152
 
Hi vijchag,

You can use B0700068 - RetrieveDayofWeek, this function you pass the date and return the day of the week in number and description. So you compose the first day date month (it's easy create a string concat '01' + month + year and call to convert string to date function) and call this function.

Regards,
Alfre.
 
Back
Top