Skip to main content
November 11, 2022
Question

Hi, retrive a date range based on the weeknumber and year

  • November 11, 2022
  • 1 reply
  • 0 views

Hi, can anyone teach me how to retrieve the week range based on the weeknumber and year.

For example, the user selects a date. I use the weeknum(ri!startDate) already retrieve the weeknumber and the year(ri!startDate),

so I already have the weeknumber and the year already,

how to retrieve the date range from the week number and year ?

such as 11/11/2022, week number is 47 and the year is 2022, 

how to we retrieve the date range like " 7/11/2022 - 11/11/2022 ?

anyone can help or assist me [emoticon:c4563cd7d5574777a71c318021cbbcc8]

    1 reply

    stefanhelzle0001
    November 11, 2022

    Instead of using the number of the week, use the number of the day in the week of the date the user selected.

    https://docs.appian.com/suite/help/22.3/fnc_date_and_time_weekday.html

    You can then subtract that number from the selected date to get the first day in that week, and add 5/7 days to get the last day.