Finding the earliest date in a table

Hello everyone,

I have data table that I have to iterate through to find the earliest date. How do I go about this?
image Here is a sample of how my datatable.
Day&Dates.xlsx (8.9 KB)

Thank you & Regards,
Hariz D

Hi @harizd
Please refer the below post!

4 Likes

Hi,

If you are good with Linq queries you can refer the above post, if not i have used for each loop and DateDiff function to retrieve the earliest date.

Please refer the below workflow.

Sequence.xaml (10.0 KB)

4 Likes

Hello @anil5 , @Vinutha

Thank you so much for the reply. I was a struggling a bit trying to use Linq queries. The xaml file you’ve given has really helped me solved this problem. :grin: I really appreciated you guys’ help.

@anil5

I have a question regarding about this particular activity

would it be okay if you explain to me what does this line of code do?

image
I’m also curious about this variable. is this supposed to increment? i couldn’t find any incremental operation in the workflow

Hi,

The intCounter variable is from for each output, which tells the index of each item in datatable and it increments automatically for the next item, so manually we don’t have to increment it.

Datediff method gets the difference between 2 dates mentioned, the first parameter dateinterval.day is for how many days between 2 dates.

1 Like

I see. Thank you for the explanation @anil5 :smiley:

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