cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

format date bo

azazeererer
Participant
0 Kudos
585

Hello,

I have in-universe attribute "YYYY-WW" which displays the Year and Week number. example: 2022-01, 2022-02, 2022-03..

I want, from the "YYYY-WW" attribute, to display the date with the first day of this week, example

2022-01 => will display ==> 25/12/2021

2022-02 => will display ==> 03/01/2022

2022-03 => will display ==> 10/01/2022

2022-04 => will display ==> 17/01/2022

how can i do this with Bo 4.2 sp7 plz?

thanks in advance

Regards

Accepted Solutions (1)

Accepted Solutions (1)

ayman_salem
Active Contributor
0 Kudos

Define the following variables:

v_WeekN: =ToNumber(Right([v_WeekT]; 2))

v_FirstDayInYear: =ToDate("01/01/"+Left([v_WeekT]; 4); "dd/MM/yyyy")

v_DofWFirstDayInYear: =DayNumberOfWeek([v_FirstDayInYear])

v_NoOfDays: =([v_WeekN]*7-[v_DofWFirstDayInYear] ) - 6

v_Date: =RelativeDate([v_FirstDayInYear];[v_NoOfDays])

...

I hope it helps

azazeererer
Participant
0 Kudos

it's Ok. Very thanks to you.

Answers (0)