How to get row value from row index in datatable

Hello everybody,
I want to get the row value from row index in the table. But i dont know how to do it.
I have calendar table like below.
キャプチャ

Step1: use for each row to read calendar table and create row index in the properties.
Step 2: use assign to get the last day before the 20th date (example: lastDay = “2022/08/19”)
Step 3: i want to get the date before the last day 5 days (this is 2022/08/08)
From step 2 i get index of lastday is “9” ⇒ index of the date before the last day 5 days is “4” but i cant get value row item.

How can I achieve that ?
Regards

Hi,

Is your final requrement to get row value of 2022/08/08? If so, the following will work without getting row index.

dt.AsEnumerable.Where(Function(r) DateTime.Parse(r("日付").ToString)<New Date(2022,8,20)).OrderByDescending(Function(r) DateTime.Parse(r("日付").ToString)).Skip(5).First.Item("日付").toString

Regards,

1 Like

Hi @Yoichi
Thanks for your answer, it worked.

Regards,

1 Like

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