特定日を軸に、直後の金曜日の日付を取得したい

UiPath初心者です。

指定日を軸に(データテーブル上に日付が並んでいます。)
直後の金曜日の日付を取得したいです。

どのようにすれば取得できるのか教えて頂きたくよろしくお願いいたします。

Hi @miwa_yamamoto

Can you confirm this is the task

  • You need to process only the dates which are friday right?

You can try like this

  • Loop through the rows and give a condition like
  • Datetime.ParseExact(Row(“Date”).tostring,{“dd.MM.yyyy”,“dd/MM/yyyy”,“You can give various formats here”},System.Globalization.CultureInfo.InvariantCulture,DateTimeStyles.None).DayOfWeek.ToString = “Friday”

then process the steps

Regards
Sudharsan

1 Like

dayofweekで曜日が取れます。
whileアクティビティで、起点日付が金曜日で無い…条件で、whileアクティビティの中の処理で、起点日付に.addday(1)して…

このループを抜けたら、起点日付は金曜日になっている(はず)

1 Like

こんにちは

やり方はいろいろありますが、dをDateTime型の変数とすると、以下の式で次の金曜日の日付が返ります。(dが金曜日の場合は、次の金曜日が返ります。)

d.AddDays(5-7*CInt(CInt(d.DayOfWeek)>=5)-CInt(d.DayOfWeek))
1 Like

Sudharsan_AIT様
HANACCHI様
Yoichi様

いつもありがとうございます。
一番簡単に出来そうな Yoichi様の式でトライしてみようと思います。
本当にありがとうございます。

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.